fisx
fisx::SimpleIni Class Reference

Public Member Functions

 SimpleIni (std::string fileName)
 
void readFileName (std::string fileName)
 
const std::vector< std::string > & getSections ()
 
void getSubsections (const std::string &parent, std::vector< std::string > &destination, const bool &caseSensitive=true)
 
const std::map< std::string, std::string > & readSection (const std::string &section, const bool &caseSensitive=true)
 

Static Public Member Functions

static void toUpper (std::string &s, const std::locale &loc=std::locale())
 
static void toLower (std::string &s, const std::locale &loc=std::locale())
 
template<typename T >
static void parseStringAsSingleValue (const std::string &keyContent, T &destination, const T &defaultValue)
 
template<typename T >
static void parseStringAsMultipleValues (const std::string &keyContent, std::vector< T > &destination, const T &defaultValue, const char &separator=',')
 
template<typename T >
static bool stringConverter (const std::string &str, T &number)
 
static bool startsWith (const std::string &stringToCheck, const std::string &testString)
 

Member Function Documentation

§ getSections()

const std::vector< std::string > & fisx::SimpleIni::getSections ( )

Get all the section names in the file.

§ getSubsections()

void fisx::SimpleIni::getSubsections ( const std::string &  parent,
std::vector< std::string > &  destination,
const bool &  caseSensitive = true 
)

Get all the file section names in the file with the provided parent

§ parseStringAsSingleValue()

template<typename T >
static void fisx::SimpleIni::parseStringAsSingleValue ( const std::string &  keyContent,
T &  destination,
const T &  defaultValue 
)
inlinestatic

Static method to parse a string

§ readSection()

const std::map< std::string, std::string > & fisx::SimpleIni::readSection ( const std::string &  section,
const bool &  caseSensitive = true 
)

Read a particular section with the option to be case sensitive or not. It returns a map<string, string> with the key and the key content. Attention: subsections are not considered keys. If the section is not present, it returns an empty map.

§ startsWith()

static bool fisx::SimpleIni::startsWith ( const std::string &  stringToCheck,
const std::string &  testString 
)
inlinestatic

Utility function (from Kleist in stackoverflow) to check if a string starts with testString

§ toLower()

static void fisx::SimpleIni::toLower ( std::string &  s,
const std::locale &  loc = std::locale() 
)
inlinestatic

Static method to convert a string to lower case using supplied locale

§ toUpper()

static void fisx::SimpleIni::toUpper ( std::string &  s,
const std::locale &  loc = std::locale() 
)
inlinestatic

Static method to convert a string to upper case using supplied locale


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