# 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_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 Methods

bool operator== (const CVar& var) const
bool operator!= (const CVar& var) const
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...


Detailed Description

CVar class.

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

Example: see the CConfigFile example

Author(s):
Vianney Lecroart , Nevrax France
Date:
2000

Definition at line 127 of file config_file.h.


Member Enumeration Documentation

enum NLMISC::CConfigFile::CVar::TVarType
 

Enumeration values:
T_INT  
T_STRING  
T_REAL  

Definition at line 165 of file config_file.h.


Member Function Documentation

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.

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.

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.

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.

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

Definition at line 146 of file config_file.cpp.

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

Definition at line 132 of file config_file.cpp.

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

Set the content of the variable as a double.

Definition at line 112 of file config_file.cpp.

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

Set the content of the variable as a float.

Definition at line 119 of file config_file.cpp.

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.

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

Set the content of the variable as a STL string.

Definition at line 124 of file config_file.cpp.

int NLMISC::CConfigFile::CVar::size ( ) const
 

Definition at line 151 of file config_file.cpp.


Member Data Documentation

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

bool NLMISC::CConfigFile::CVar::Comp
 

Definition at line 169 of file config_file.h.

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

Definition at line 170 of file config_file.h.

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

Definition at line 167 of file config_file.h.

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

Definition at line 171 of file config_file.h.

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

Definition at line 172 of file config_file.h.

TVarType NLMISC::CConfigFile::CVar::Type
 

Definition at line 168 of file config_file.h.

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: