PARTONS/ElementaryUtils  
Basic utility softwares (Logger, threads, etc)
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
ElemUtils::IniFileParser Class Reference

Public Member Functions

 IniFileParser ()
 Constructor. More...
 
virtual ~IniFileParser ()
 Default destructor. More...
 
void parse (const std::string &configFilePath)
 
std::map< std::string, std::string > getValues ()
 
std::string getString (const std::string &key)
 
std::string getString (const std::string &section, const std::string &key)
 
bool checkIfAvailable (const std::string &section, const std::string &key) const
 
bool checkIfAvailable (const std::string &key) const
 
const std::string & getFilePath () const
 

Static Public Attributes

static std::string SECTION_KEY_CONCATENATOR = "="
 

Private Member Functions

void analyse (std::string &fileLine, std::string &sectionName, const unsigned int fileLineNumber)
 
void analyseSection (const std::string &fileLine, std::string &sectionName, const unsigned int fileLineNumber)
 
void analyseValue (const std::string &fileLine, const std::string &sectionName)
 
std::string makeKey (const std::string &sectionName, const std::string &key) const
 

Private Attributes

std::string m_filePath
 
std::map< std::string, std::string > m_values
 
std::map< std::string, std::string >::iterator m_it
 

Constructor & Destructor Documentation

◆ IniFileParser()

ElemUtils::IniFileParser::IniFileParser ( )

Constructor.

Parameters
configFilePath

◆ ~IniFileParser()

ElemUtils::IniFileParser::~IniFileParser ( )
virtual

Default destructor.

Member Function Documentation

◆ analyse()

void ElemUtils::IniFileParser::analyse ( std::string &  fileLine,
std::string &  sectionName,
const unsigned int  fileLineNumber 
)
private

◆ analyseSection()

void ElemUtils::IniFileParser::analyseSection ( const std::string &  fileLine,
std::string &  sectionName,
const unsigned int  fileLineNumber 
)
private

◆ analyseValue()

void ElemUtils::IniFileParser::analyseValue ( const std::string &  fileLine,
const std::string &  sectionName 
)
private

◆ checkIfAvailable() [1/2]

bool ElemUtils::IniFileParser::checkIfAvailable ( const std::string &  key) const

◆ checkIfAvailable() [2/2]

bool ElemUtils::IniFileParser::checkIfAvailable ( const std::string &  section,
const std::string &  key 
) const

◆ getFilePath()

const std::string & ElemUtils::IniFileParser::getFilePath ( ) const

◆ getString() [1/2]

std::string ElemUtils::IniFileParser::getString ( const std::string &  key)

◆ getString() [2/2]

std::string ElemUtils::IniFileParser::getString ( const std::string &  section,
const std::string &  key 
)

◆ getValues()

std::map< std::string, std::string > ElemUtils::IniFileParser::getValues ( )

◆ makeKey()

std::string ElemUtils::IniFileParser::makeKey ( const std::string &  sectionName,
const std::string &  key 
) const
private

◆ parse()

void ElemUtils::IniFileParser::parse ( const std::string &  configFilePath)

Member Data Documentation

◆ m_filePath

std::string ElemUtils::IniFileParser::m_filePath
private

◆ m_it

std::map<std::string, std::string>::iterator ElemUtils::IniFileParser::m_it
private

◆ m_values

std::map<std::string, std::string> ElemUtils::IniFileParser::m_values
private

◆ SECTION_KEY_CONCATENATOR

std::string ElemUtils::IniFileParser::SECTION_KEY_CONCATENATOR = "="
static

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