# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLMISC::CConfigFile::CVar Struct Reference

CVar class. More...

#include <config_file.h>

List of all members.

Internal use

enum  TVarType { T_UNKNOWN, T_INT, T_STRING, T_REAL }
std::string Name
TVarType Type
bool Comp
std::vector< int > IntValues
std::vector< double > RealValues
std::vector< std::string > StrValues
void(* Callback )(CVar &var)
char * TypeName [] = { "Integer", "String", "Float" }

Public Types


Public Methods

 CVar ()
bool operator== (const CVar &var) const
bool operator!= (const CVar &var) const
void add (const CVar &var)
int size () const
Access to the variable content.
int asInt (int index=0) const
 Get the content of the variable as an integer. More...

double asDouble (int index=0) const
 Get the content of the variable as a double. More...

float asFloat (int index=0) const
 Get the content of the variable as a float. More...

const std::string & asString (int index=0) const
 Get the content of the variable as a STL string. More...

Set the variable content.
void setAsInt (int val, int index=0)
 Set the content of the variable as an integer. More...

void setAsDouble (double val, int index=0)
 Set the content of the variable as a double. More...

void setAsFloat (float val, int index=0)
 Set the content of the variable as a float. More...

void setAsString (std::string val, int index=0)
 Set the content of the variable as a STL string. More...

void setAsInt (std::vector< int > vals)
 Set the content of the aray variable as an integer. More...

void setAsDouble (std::vector< double > vals)
 Set the content of the aray variable as a double. More...

void setAsFloat (std::vector< float > vals)
 Set the content of the aray variable as a float. More...

void setAsString (std::vector< std::string > vals)
 Set the content of the aray variable as a string. More...


Detailed Description

CVar class.

Used by CConfigFile. A CVar is return when you want to have a variable.

Example: see the CConfigFile example

Author:
Vianney Lecroart , Nevrax France
Date:
2000

Definition at line 132 of file config_file.h.


Member Enumeration Documentation

enum NLMISC::CConfigFile::CVar::TVarType
 

Enumeration values:
T_UNKNOWN 
T_INT 
T_STRING 
T_REAL 

Definition at line 186 of file config_file.h.


Constructor & Destructor Documentation

NLMISC::CConfigFile::CVar::CVar   [inline]
 

Definition at line 136 of file config_file.h.

References T_UNKNOWN, and Type.


Member Function Documentation

void NLMISC::CConfigFile::CVar::add const CVar &    var
 

Definition at line 184 of file config_file.cpp.

References IntValues, RealValues, StrValues, T_INT, T_REAL, T_STRING, and Type.

double NLMISC::CConfigFile::CVar::asDouble int    index = 0 const
 

Get the content of the variable as a double.

Definition at line 74 of file config_file.cpp.

References CheckType, index, IntValues, Name, RealValues, StrValues, T_INT, T_REAL, T_STRING, and Type.

Referenced by asFloat.

float NLMISC::CConfigFile::CVar::asFloat int    index = 0 const
 

Get the content of the variable as a float.

Definition at line 91 of file config_file.cpp.

References asDouble, and index.

int NLMISC::CConfigFile::CVar::asInt int    index = 0 const
 

Get the content of the variable as an integer.

Definition at line 57 of file config_file.cpp.

References CheckType, index, IntValues, Name, RealValues, StrValues, T_INT, T_REAL, T_STRING, and Type.

const std::string & NLMISC::CConfigFile::CVar::asString int    index = 0 const
 

Get the content of the variable as a STL string.

Definition at line 96 of file config_file.cpp.

References index, Name, StrValues, T_STRING, and Type.

bool NLMISC::CConfigFile::CVar::operator!= const CVar &    var const
 

Definition at line 179 of file config_file.cpp.

bool NLMISC::CConfigFile::CVar::operator== const CVar &    var const
 

Definition at line 164 of file config_file.cpp.

References IntValues, RealValues, StrValues, T_INT, T_REAL, T_STRING, and Type.

void NLMISC::CConfigFile::CVar::setAsDouble std::vector< double >    vals
 

Set the content of the aray variable as a double.

Definition at line 140 of file config_file.cpp.

References Name, RealValues, T_REAL, and Type.

void NLMISC::CConfigFile::CVar::setAsDouble double    val,
int    index = 0
 

Set the content of the variable as a double.

Definition at line 113 of file config_file.cpp.

References index, Name, RealValues, T_REAL, and Type.

Referenced by setAsFloat.

void NLMISC::CConfigFile::CVar::setAsFloat std::vector< float >    vals
 

Set the content of the aray variable as a float.

Definition at line 146 of file config_file.cpp.

References Name, RealValues, T_REAL, and Type.

void NLMISC::CConfigFile::CVar::setAsFloat float    val,
int    index = 0
 

Set the content of the variable as a float.

Definition at line 121 of file config_file.cpp.

References index, and setAsDouble.

void NLMISC::CConfigFile::CVar::setAsInt std::vector< int >    vals
 

Set the content of the aray variable as an integer.

Definition at line 134 of file config_file.cpp.

References IntValues, Name, T_INT, and Type.

void NLMISC::CConfigFile::CVar::setAsInt int    val,
int    index = 0
 

Set the content of the variable as an integer.

Definition at line 105 of file config_file.cpp.

References index, IntValues, Name, T_INT, and Type.

void NLMISC::CConfigFile::CVar::setAsString std::vector< std::string >    vals
 

Set the content of the aray variable as a string.

Definition at line 158 of file config_file.cpp.

References Name, StrValues, T_STRING, and Type.

void NLMISC::CConfigFile::CVar::setAsString std::string    val,
int    index = 0
 

Set the content of the variable as a STL string.

Definition at line 126 of file config_file.cpp.

References index, Name, StrValues, T_STRING, and Type.

int NLMISC::CConfigFile::CVar::size   const
 

Definition at line 198 of file config_file.cpp.

References IntValues, RealValues, StrValues, T_INT, T_REAL, and T_STRING.


Member Data Documentation

void(* NLMISC::CConfigFile::CVar::Callback)(CVar &var)
 

bool NLMISC::CConfigFile::CVar::Comp
 

Definition at line 190 of file config_file.h.

std::vector<int> NLMISC::CConfigFile::CVar::IntValues
 

Definition at line 191 of file config_file.h.

Referenced by add, asDouble, asInt, operator==, setAsInt, and size.

std::string NLMISC::CConfigFile::CVar::Name
 

Definition at line 188 of file config_file.h.

Referenced by asDouble, asInt, asString, setAsDouble, setAsFloat, setAsInt, and setAsString.

std::vector<double> NLMISC::CConfigFile::CVar::RealValues
 

Definition at line 192 of file config_file.h.

Referenced by add, asDouble, asInt, operator==, setAsDouble, setAsFloat, and size.

std::vector<std::string> NLMISC::CConfigFile::CVar::StrValues
 

Definition at line 193 of file config_file.h.

Referenced by add, asDouble, asInt, asString, operator==, setAsString, and size.

TVarType NLMISC::CConfigFile::CVar::Type
 

Definition at line 189 of file config_file.h.

Referenced by add, asDouble, asInt, asString, CVar, operator==, setAsDouble, setAsFloat, setAsInt, and setAsString.

char * NLMISC::CConfigFile::CVar::TypeName = { "Integer", "String", "Float" } [static]
 

Definition at line 55 of file config_file.cpp.


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