20 #ifndef CONFIGREADER_H
21 #define CONFIGREADER_H
35 class configReader_Unit_ParseProgramName_Test;
66 configLineBase (
const string &name,
const int matchType ) : name ( name ), matchType ( matchType ) {}
75 virtual void setValue (
const string &str ) = 0;
96 configLine (
const string &name,
const T &value,
const int matchType ) :
configLineBase ( name, matchType ), value ( value ) {}
186 customConfigPath = path;
193 if ( !readSuccess ) {
219 bool reopenStreams();
230 bool parseConfigFile ( istream &stream, vector<configLineBase *> &readLines );
239 bool parseConfigBlock ( istream &stream, vector<configLineBase *> &readLines );
245 string getApplicationName()
const;
251 string getHomeDir()
const;
257 void stripLeadingTrailingWhitespace (
string &str )
const;
259 const string globalConfigPath =
"/etc/rambrain.conf";
260 string localConfigPath =
"";
261 string customConfigPath =
"";
269 bool readSuccess =
false;
273 friend class ::configReader_Unit_ParseProgramName_Test;
280 #endif // CONFIGREADER_H
virtual void setValue(const string &str)
Reset the value from a string.
swapPolicy
An enumeration to regulate how the swap should define when it approaches it's set boundary...
configLine< swapPolicy > policy
configLine< bool > enableDMA
virtual ~configLine()
Destructor.
configLine(const string &name, const T &value, const int matchType)
Create a new config option.
Class for config key value pairs represented by a line in a config file.
configLine< string > swapfiles
configuration & getConfig()
Simple getter.
Main struct to save configuration variables.
void setReread()
Simple setter.
rambrainConfig config
You will find the object in managedMemory.cpp as we have to define it in some 'used' file in the link...
Class to handle regex matching used for parsing configuration files.
virtual ~configLineBase()
Destructor.
void setCustomConfigPath(const string &path)
Simple setter.
bool readSuccessfully() const
Simple getter.
Reader class to read in and properly parse config files.
configLineBase(const string &name, const int matchType)
Create a new config line.
configLine< global_bytesize > swapMemory
vector< configLineBase * > configOptions
Base class for config lines.