Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
ConfigFileReader Class Reference

#include <mitkConfigFileReader.h>

Collaboration diagram for ConfigFileReader:

Public Member Functions

 ConfigFileReader (std::string const &configFile)
 
void ReadFile (std::string const &filePath)
 
void ReadStream (std::istream &stream)
 
std::string Value (std::string const &section, std::string const &entry) const
 
std::string Value (const std::string &section, const std::string &entry, const std::string &standard)
 
int IntValue (const std::string &section, const std::string &entry) const
 
int IntValue (const std::string &section, const std::string &entry, int standard)
 
std::vector< std::string > Vector (std::string const &section, unsigned int index) const
 
unsigned int ListSize (std::string const &section) const
 
unsigned int ListSize (std::string const &section, unsigned int standard)
 

Protected Types

typedef std::map< std::string, std::string > ContentType
 
typedef std::map< std::string, std::vector< std::string > > ListContentType
 

Protected Member Functions

std::string Trim (std::string const &source, char const *delim=" \t\r\n")
 
std::string RemoveComment (std::string const &source, char const *delim="#;")
 
std::string ListIndex (std::string const &section, unsigned int index) const
 
std::string ContentIndex (std::string const &section, std::string const &entry) const
 
std::string ListSizeIndex (std::string const &section) const
 

Protected Attributes

ContentType m_ConfigContent
 
ListContentType m_ListContent
 
std::map< std::string, unsigned int > m_ListSize
 

Detailed Description

Definition at line 23 of file mitkConfigFileReader.h.

Member Typedef Documentation

◆ ContentType

typedef std::map<std::string, std::string> ConfigFileReader::ContentType
protected

Definition at line 28 of file mitkConfigFileReader.h.

◆ ListContentType

typedef std::map<std::string, std::vector<std::string> > ConfigFileReader::ListContentType
protected

Definition at line 29 of file mitkConfigFileReader.h.

Constructor & Destructor Documentation

◆ ConfigFileReader()

ConfigFileReader::ConfigFileReader ( std::string const &  configFile)
inline

Definition at line 84 of file mitkConfigFileReader.h.

References ReadFile().

Member Function Documentation

◆ ContentIndex()

std::string ConfigFileReader::ContentIndex ( std::string const &  section,
std::string const &  entry 
) const
inlineprotected

Definition at line 67 of file mitkConfigFileReader.h.

Referenced by IntValue(), ReadStream(), and Value().

◆ IntValue() [1/2]

int ConfigFileReader::IntValue ( const std::string &  section,
const std::string &  entry 
) const
inline

Definition at line 158 of file mitkConfigFileReader.h.

References Value().

Referenced by IntValue().

◆ IntValue() [2/2]

int ConfigFileReader::IntValue ( const std::string &  section,
const std::string &  entry,
int  standard 
)
inline

Definition at line 166 of file mitkConfigFileReader.h.

References ContentIndex(), IntValue(), and m_ConfigContent.

◆ ListIndex()

std::string ConfigFileReader::ListIndex ( std::string const &  section,
unsigned int  index 
) const
inlineprotected

Definition at line 58 of file mitkConfigFileReader.h.

Referenced by ReadStream(), and Vector().

◆ ListSize() [1/2]

unsigned int ConfigFileReader::ListSize ( std::string const &  section) const
inline

Definition at line 189 of file mitkConfigFileReader.h.

References ListSizeIndex(), and m_ListSize.

Referenced by ListSize(), and ReadStream().

◆ ListSize() [2/2]

unsigned int ConfigFileReader::ListSize ( std::string const &  section,
unsigned int  standard 
)
inline

Definition at line 198 of file mitkConfigFileReader.h.

References ListSize(), ListSizeIndex(), and m_ListSize.

◆ ListSizeIndex()

std::string ConfigFileReader::ListSizeIndex ( std::string const &  section) const
inlineprotected

Definition at line 75 of file mitkConfigFileReader.h.

Referenced by ListSize(), and ReadStream().

◆ ReadFile()

void ConfigFileReader::ReadFile ( std::string const &  filePath)
inline

Definition at line 89 of file mitkConfigFileReader.h.

References ReadStream().

Referenced by ConfigFileReader().

◆ ReadStream()

void ConfigFileReader::ReadStream ( std::istream &  stream)
inline

◆ RemoveComment()

std::string ConfigFileReader::RemoveComment ( std::string const &  source,
char const *  delim = "#;" 
)
inlineprotected

Definition at line 49 of file mitkConfigFileReader.h.

References Trim().

Referenced by ReadStream().

◆ Trim()

std::string ConfigFileReader::Trim ( std::string const &  source,
char const *  delim = " \t\r\n" 
)
inlineprotected

Definition at line 35 of file mitkConfigFileReader.h.

Referenced by ReadStream(), and RemoveComment().

◆ Value() [1/2]

std::string ConfigFileReader::Value ( const std::string &  section,
const std::string &  entry,
const std::string &  standard 
)
inline

Definition at line 146 of file mitkConfigFileReader.h.

References ContentIndex(), m_ConfigContent, and Value().

◆ Value() [2/2]

std::string ConfigFileReader::Value ( std::string const &  section,
std::string const &  entry 
) const
inline

Definition at line 137 of file mitkConfigFileReader.h.

References ContentIndex(), and m_ConfigContent.

Referenced by IntValue(), and Value().

◆ Vector()

std::vector<std::string> ConfigFileReader::Vector ( std::string const &  section,
unsigned int  index 
) const
inline

Definition at line 180 of file mitkConfigFileReader.h.

References ListIndex(), and m_ListContent.

Member Data Documentation

◆ m_ConfigContent

ContentType ConfigFileReader::m_ConfigContent
protected

Definition at line 31 of file mitkConfigFileReader.h.

Referenced by IntValue(), ReadStream(), and Value().

◆ m_ListContent

ListContentType ConfigFileReader::m_ListContent
protected

Definition at line 32 of file mitkConfigFileReader.h.

Referenced by ReadStream(), and Vector().

◆ m_ListSize

std::map<std::string, unsigned int > ConfigFileReader::m_ListSize
protected

Definition at line 33 of file mitkConfigFileReader.h.

Referenced by ListSize(), and ReadStream().


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