File ini.h

namespace mINI

Typedefs

using INIStructure = INIMap<INIMap<std::string>>
class INIFile
#include <ini.h>

Public Functions

inline INIFile(std::filesystem::path filename)
~INIFile() = default
inline bool read(INIStructure &data) const
inline bool generate(INIStructure const &data, bool pretty = false) const
inline bool write(INIStructure &data, bool pretty = false) const

Private Members

std::filesystem::path filename
class INIGenerator
#include <ini.h>

Public Functions

inline INIGenerator(std::filesystem::path const &filename)
~INIGenerator() = default
inline bool operator<<(INIStructure const &data)

Public Members

bool prettyPrint = false

Private Members

std::ofstream fileWriteStream
template<typename T>
class INIMap
#include <ini.h>

Public Types

using const_iterator = typename T_DataContainer::const_iterator

Public Functions

INIMap() = default
inline INIMap(INIMap const &other)
inline T &operator[](std::string key)
inline T get(std::string key) const
inline bool has(std::string key) const
inline void set(std::string key, T obj)
inline void set(T_MultiArgs const &multiArgs)
inline bool remove(std::string key)
inline void clear()
inline std::size_t size() const
inline const_iterator begin() const
inline const_iterator end() const

Private Types

using T_DataIndexMap = std::unordered_map<std::string, std::size_t>
using T_DataItem = std::pair<std::string, T>
using T_DataContainer = std::vector<T_DataItem>
using T_MultiArgs = typename std::vector<std::pair<std::string, T>>

Private Functions

inline std::size_t setEmpty(std::string &key)

Private Members

T_DataIndexMap dataIndexMap
T_DataContainer data
class INIReader
#include <ini.h>

Public Types

using T_LineData = std::vector<std::string>
using T_LineDataPtr = std::shared_ptr<T_LineData>

Public Functions

inline INIReader(std::filesystem::path const &filename, bool keepLineData = false)
~INIReader() = default
inline bool operator>>(INIStructure &data)
inline T_LineDataPtr getLines()

Public Members

bool isBOM = false

Private Functions

inline T_LineData readFile()

Private Members

std::ifstream fileReadStream
T_LineDataPtr lineData
class INIWriter
#include <ini.h>

Public Functions

inline INIWriter(std::filesystem::path filename)
~INIWriter() = default
inline bool operator<<(INIStructure &data)

Public Members

bool prettyPrint = false

Private Types

using T_LineData = std::vector<std::string>
using T_LineDataPtr = std::shared_ptr<T_LineData>

Private Functions

inline T_LineData getLazyOutput(T_LineDataPtr const &lineData, INIStructure &data, INIStructure &original) const

Private Members

std::filesystem::path filename
namespace INIParser

Typedefs

using T_ParseValues = std::pair<std::string, std::string>

Enums

enum class PDataType : char

Values:

enumerator PDATA_NONE
enumerator PDATA_COMMENT
enumerator PDATA_SECTION
enumerator PDATA_KEYVALUE
enumerator PDATA_UNKNOWN

Functions

inline PDataType parseLine(std::string line, T_ParseValues &parseData)
namespace INIStringUtil

Functions

inline void trim(std::string &str)
inline void toLower(std::string &str)
inline void replace(std::string &str, std::string const &a, std::string const &b)

Variables

const char *const whitespaceDelimiters = " \t\n\r\f\v"
const char *const endl = "\n"