Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

readConfig Class Reference

#include <Util/readConfig.H>

Collaboration diagram for readConfig:

Collaboration graph
[legend]
List of all members.

Detailed Description

open a config file and parse it for data retreaval

This class works to open a file for parsing which has name value key pairs. Each pair is seperated and loaded into a vector. Values can then be retrieved by either calling a values item number or name. This will then return the value. Comments can be handeled in the config file so long as they are in the form '# words #'. That is place a # with a space before and after each comment.

Definition at line 64 of file readConfig.H.

Public Member Functions

 readConfig ()
 constructor with initial size = 25
 readConfig (int size)
 constructor with initial size
 ~readConfig ()
 destructor for readConfig
void openFile (const char *filename, bool echo=false)
 open a config file with filename
void writeFile ()
 write the file back to disk as filename
void writeFile (const char *filename)
 write the file back to disk with a new file name
bool readFileTrue (int itemNumber)
 returns true if item number itemNumber exists
int readFileValueI (int itemNumber)
 return value of item as an integer
float readFileValueF (int itemNumber)
 return value of item as a float
std::string readFileValueS (int itemNumber)
 return value of item as a string
const char * readFileValueC (int itemNumber)
 return value of item as a C style char*
std::string readFileValueName (int itemNumber)
 return the item name
const char * readFileValueNameC (int itemNumber)
 return item name as a C style char*
float readFileValueNameF (int itemNumber)
 return item name as a float
float getItemValueF (std::string itemName)
 return the float value of a number with name itemName
std::string getItemValueS (std::string itemName)
 return the string value of a number with name itemName
bool getItemValueB (std::string itemName)
 return a bool representation of the value 1 = true else false
const char * getItemValueC (std::string itemName)
 return the char* value of a number with name itemName
void setItemValue (std::string itemName, float _set)
 Set the item with string name itemName to a float _set.
void setItemValue (std::string itemName, std::string _set)
 Set the item with string name itemName to a string _set.
void setItemValue (std::string itemName, const char *_set)
 Set the item with string name itemName to a const char* _set.
void setFileValue (int itemNumber, float _set)
 Set the item signified by its number to a float.
void setFileValue (int itemNumber, std::string _set)
 Set the item signified by its number to a string.
void setFileValue (int itemNumber, const char *_set)
 Set the item signified by its number to a const char*.
int addItemValue (std::string itemName, float _set)
 Set the item with string name itemName to a float _set.
int addItemValue (std::string itemName, std::string _set)
 Set the item with string name itemName to a string _set.
int addItemValue (std::string itemName, const char *_set)
 Set the item with string name itemName to a string _set.
int itemCount ()
 returns how many items exist


Constructor & Destructor Documentation

readConfig::readConfig  ) 
 

constructor with initial size = 25

Definition at line 51 of file readConfig.C.

readConfig::readConfig int  size  ) 
 

constructor with initial size

Definition at line 60 of file readConfig.C.

readConfig::~readConfig  ) 
 

destructor for readConfig

Definition at line 68 of file readConfig.C.


Member Function Documentation

int readConfig::addItemValue std::string  itemName,
const char *  _set
 

Set the item with string name itemName to a string _set.

Definition at line 361 of file readConfig.C.

References addItemValue().

int readConfig::addItemValue std::string  itemName,
std::string  _set
 

Set the item with string name itemName to a string _set.

Definition at line 344 of file readConfig.C.

References LINFO.

int readConfig::addItemValue std::string  itemName,
float  _set
 

Set the item with string name itemName to a float _set.

Definition at line 339 of file readConfig.C.

References sformat().

Referenced by addItemValue().

bool readConfig::getItemValueB std::string  itemName  ) 
 

return a bool representation of the value 1 = true else false

Definition at line 239 of file readConfig.C.

References i, LFATAL, and x.

Referenced by featureClusterVision< FLOAT >::fCVsetUpfCV(), ScaleRemoveSurprise< FLOAT >::ScaleRemoveSurprise(), segmentImageTrackMC::segmentImageTrackMC(), and ScaleSurpriseControl< FLOAT >::SSCreadConfig().

const char * readConfig::getItemValueC std::string  itemName  ) 
 

return the char* value of a number with name itemName

Definition at line 259 of file readConfig.C.

References i, LFATAL, and x.

Referenced by main().

float readConfig::getItemValueF std::string  itemName  ) 
 

return the float value of a number with name itemName

Definition at line 205 of file readConfig.C.

References i, LFATAL, and x.

Referenced by ContourNeuronCreate< TC2 >::CreateNeuron(), featureClusterVision< FLOAT >::fCVsetUpfCV(), SimulationViewerNerdCam::init(), ColorSegmenter::isolateOrange(), main(), NPclassify::NPclassify(), NPclassify2< FLOAT >::NPsetup(), segmentImageMerge2::resetAll(), Omni< T >::run(), ScaleRemoveSurprise< FLOAT >::ScaleRemoveSurprise(), segmentImageMerge2::segmentImageMerge2(), segmentImageTrackMC::segmentImageTrackMC(), CINNICstatsRun::setConfig(), BeoSubCross::setupOrangeTracker(), and ScaleSurpriseControl< FLOAT >::SSCreadConfig().

string readConfig::getItemValueS std::string  itemName  ) 
 

return the string value of a number with name itemName

Definition at line 222 of file readConfig.C.

References i, LFATAL, and x.

Referenced by featureClusterVision< FLOAT >::fCVsetUpfCV(), SimulationViewerNerdCam::init(), and CINNICstatsRun::setConfig().

int readConfig::itemCount  ) 
 

returns how many items exist

Definition at line 367 of file readConfig.C.

Referenced by main(), CINNICstatsRun::runStandardStats(), and CINNICstatsRun::setStuff().

void readConfig::openFile const char *  filename,
bool  echo = false
 

open a config file with filename

Definition at line 72 of file readConfig.C.

References in, and LINFO.

Referenced by BeobotConfig::BeobotConfig(), cameraConf::cameraConf(), featureClusterVision< FLOAT >::fCVsetUpfCV(), SimulationViewerNerdCam::init(), ColorSegmenter::isolateOrange(), main(), segmentImageMerge2::resetAll(), ScaleRemoveSurprise< FLOAT >::ScaleRemoveSurprise(), segmentImageMerge2::segmentImageMerge2(), segmentImageTrackMC::segmentImageTrackMC(), BeoSubCross::setupOrangeTracker(), segmentImageMerge2::SIMSetCluster(), and ScaleSurpriseControl< FLOAT >::SSCreadConfig().

bool readConfig::readFileTrue int  itemNumber  ) 
 

returns true if item number itemNumber exists

Definition at line 151 of file readConfig.C.

Referenced by main(), CINNICstatsRun::runPointAndFlood(), and CINNICstatsRun::runStandardStats().

const char * readConfig::readFileValueC int  itemNumber  ) 
 

return value of item as a C style char*

Definition at line 181 of file readConfig.C.

References ASSERT.

Referenced by CINNICstatsRun::runPointAndFlood(), and CINNICstatsRun::runStandardStats().

float readConfig::readFileValueF int  itemNumber  ) 
 

return value of item as a float

Definition at line 169 of file readConfig.C.

References ASSERT.

Referenced by main().

int readConfig::readFileValueI int  itemNumber  ) 
 

return value of item as an integer

Definition at line 163 of file readConfig.C.

References ASSERT.

string readConfig::readFileValueName int  itemNumber  ) 
 

return the item name

Definition at line 187 of file readConfig.C.

References ASSERT.

Referenced by main().

const char * readConfig::readFileValueNameC int  itemNumber  ) 
 

return item name as a C style char*

Definition at line 193 of file readConfig.C.

References ASSERT.

Referenced by CINNICstatsRun::runPointAndFlood(), and CINNICstatsRun::runStandardStats().

float readConfig::readFileValueNameF int  itemNumber  ) 
 

return item name as a float

Definition at line 199 of file readConfig.C.

References ASSERT.

Referenced by main().

string readConfig::readFileValueS int  itemNumber  ) 
 

return value of item as a string

Definition at line 175 of file readConfig.C.

References ASSERT.

void readConfig::setFileValue int  itemNumber,
const char *  _set
 

Set the item signified by its number to a const char*.

Definition at line 333 of file readConfig.C.

References ASSERT.

void readConfig::setFileValue int  itemNumber,
std::string  _set
 

Set the item signified by its number to a string.

Definition at line 327 of file readConfig.C.

References ASSERT.

void readConfig::setFileValue int  itemNumber,
float  _set
 

Set the item signified by its number to a float.

Definition at line 321 of file readConfig.C.

References ASSERT, and sformat().

void readConfig::setItemValue std::string  itemName,
const char *  _set
 

Set the item with string name itemName to a const char* _set.

Definition at line 306 of file readConfig.C.

References i, LFATAL, and x.

void readConfig::setItemValue std::string  itemName,
std::string  _set
 

Set the item with string name itemName to a string _set.

Definition at line 291 of file readConfig.C.

References i, LFATAL, and x.

void readConfig::setItemValue std::string  itemName,
float  _set
 

Set the item with string name itemName to a float _set.

Definition at line 276 of file readConfig.C.

References i, LFATAL, sformat(), and x.

void readConfig::writeFile const char *  filename  ) 
 

write the file back to disk with a new file name

Definition at line 138 of file readConfig.C.

References i, and out.

void readConfig::writeFile  ) 
 

write the file back to disk as filename

Definition at line 125 of file readConfig.C.

References i, and out.


The documentation for this class was generated from the following files:
Generated on Thu Dec 4 10:23:13 2008 for iLab Neuromorphic Vision Toolkit by  doxygen 1.4.4