28 #ifndef GNSS_SDR_INIREADER_H 29 #define GNSS_SDR_INIREADER_H 49 explicit INIReader(
const std::string& filename);
55 std::string
Get(
const std::string& section,
const std::string& name,
56 const std::string& default_value);
59 int64_t
GetInteger(
const std::string& section,
const std::string& name, int64_t default_value);
62 bool HasSection(
const std::string& section)
const;
65 bool HasValue(
const std::string& section,
const std::string& name)
const;
68 static std::string MakeKey(
const std::string& section,
const std::string& name);
69 static int ValueHandler(
void* user,
const char* section,
const char* name,
72 std::map<std::string, std::string> _values;
79 #endif // GNSS_SDR_INIREADER_H bool HasSection(const std::string §ion) const
Return true if the given section exists (section must contain at least one name=value pair)...
int64_t GetInteger(const std::string §ion, const std::string &name, int64_t default_value)
Get an integer (long) value from INI file, returning default_value if not found.
INIReader(const std::string &filename)
Construct INIReader and parse given filename. See ini.h for more info about the parsing.
int ParseError() const
Return the result of ini_parse(), i.e., 0 on success, line number of first error on parse error...
Read an INI file into easy-to-access name/value pairs. (Note that I've gone for simplicity here rathe...
std::string Get(const std::string §ion, const std::string &name, const std::string &default_value)
Get a string value from INI file, returning default_value if not found.
bool HasValue(const std::string §ion, const std::string &name) const
Return true if a value exists with the given section and field names.