GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
INIReader Class Reference

Read an INI file into easy-to-access name/value pairs. (Note that I've gone for simplicity here rather than speed, but it should be pretty decent.). More...

#include <INIReader.h>

Public Member Functions

 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, or -1 on file open error.
std::string Get (const std::string &section, const std::string &name, const std::string &default_value)
 Get a string value from INI file, returning default_value if not found.
int64_t GetInteger (const std::string &section, const std::string &name, int64_t default_value)
 Get an integer (long) value from INI file, returning default_value if not found.
bool HasSection (const std::string &section) const
 Return true if the given section exists (section must contain at least one name=value pair).
bool HasValue (const std::string &section, const std::string &name) const
 Return true if a value exists with the given section and field names.

Detailed Description

Read an INI file into easy-to-access name/value pairs. (Note that I've gone for simplicity here rather than speed, but it should be pretty decent.).

Definition at line 45 of file INIReader.h.

Constructor & Destructor Documentation

◆ INIReader()

INIReader::INIReader ( const std::string & filename)
explicit

Construct INIReader and parse given filename. See ini.h for more info about the parsing.

Member Function Documentation

◆ Get()

std::string INIReader::Get ( const std::string & section,
const std::string & name,
const std::string & default_value )

Get a string value from INI file, returning default_value if not found.

◆ GetInteger()

int64_t INIReader::GetInteger ( const std::string & section,
const std::string & name,
int64_t default_value )

Get an integer (long) value from INI file, returning default_value if not found.

◆ HasSection()

bool INIReader::HasSection ( const std::string & section) const

Return true if the given section exists (section must contain at least one name=value pair).

◆ HasValue()

bool INIReader::HasValue ( const std::string & section,
const std::string & name ) const

Return true if a value exists with the given section and field names.

◆ ParseError()

int INIReader::ParseError ( ) const

Return the result of ini_parse(), i.e., 0 on success, line number of first error on parse error, or -1 on file open error.


The documentation for this class was generated from the following file: