Binary configuration file based on key/value tuples. More...
#include "base/module.hh"#include "base/conf_bin.hh"#include "base/exception.hh"#include "base/file.hh"#include "base/stream.hh"#include "base/stream_funcs.hh"#include "glue/module.hh"#include "glue/conf.hh"Namespaces | |
| namespace | base |
Library of base code. | |
Defines | |
| #define | BASE_CONF_BIN_CC 1 |
| #define | CONF_BIN_WRITE(MVAL, ETYPE) |
| #define | CONF_BIN_READ(MVAL, TYPE) |
| Get tuple from STL map. | |
| #define | CONF_BIN_ACCESS |
Functions | |
| string | base::CheckObsoleteConfFilename (const string &programName) |
| bool | base::CompareTuples (const ConfBin::ConfTuple &t1, const ConfBin::ConfTuple &t2) |
Variables | |
| INTERN const string | base::BASE_CONF_BIN_VERSION_STR = "(gfx::ConfigFile v2)" |
Binary configuration file based on key/value tuples.
| #define BASE_CONF_BIN_CC 1 |
| #define CONF_BIN_ACCESS |
{ \
if ( acc == ConfBin::eAccess_WRITE ) \
return Write( key, val ); \
else \
return Read( key, val ); \
}
| #define CONF_BIN_READ | ( | MVAL, | ||
| TYPE | ||||
| ) |
{ \
if ( ! mValid ) \
{ \
CERROR << "ERROR: ConfBin::Read(): object invalid" << endl; \
return false; \
} \
\
if ( mTupleMap.find( key ) != mTupleMap.end() ) \
{ \
CHECK_TYPESIG(&mTupleMap[key],TYPESIG_CONF_TUPLE); \
if ( mTupleMap[key].mType == TYPE ) \
{ \
val = mTupleMap[key].MVAL; \
return true; \
} \
else \
{ \
CERROR << "ERROR: ConfBin::Read(): type mismatch" << endl; \
return false; \
} \
} \
else \
return false; \
}
Get tuple from STL map.
| #define CONF_BIN_WRITE | ( | MVAL, | ||
| ETYPE | ||||
| ) |
{ \
if ( ! mValid ) \
{ \
CERROR << "ERROR: ConfBin::Write(): object invalid" << endl; \
return false; \
} \
if ( mTupleMap.find(key) == mTupleMap.end() ) \
mTupleMap[key] = ConfTuple(); \
mTupleMap[key].mType = ETYPE; \
mTupleMap[key].mKey = key; \
mTupleMap[key].MVAL = val; \
if ( mAutoflush ) \
return Flush(); \
else \
return true; \
}
Palomino Flight Simulator documents generated by doxygen 1.7.1 on Tue May 15 2012 22:40:10