Namespaces | Defines | Functions | Variables

_src_base_conf_bin.cc File Reference

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)"

Detailed Description

Binary configuration file based on key/value tuples.

LastChangedDate:
2011-04-23 21:07:07 -0400 (Sat, 23 Apr 2011)
Author:
Jim E. Brooks http://www.palomino3d.org
Remarks:
Similar to GNOME's gnome_config*(). Documented at base_config_file.hh.

Define Documentation

#define BASE_CONF_BIN_CC   1
#define CONF_BIN_ACCESS
Value:
{                                                                           \
    if ( acc == ConfBin::eAccess_WRITE )                                    \
        return Write( key, val );                                           \
    else                                                                    \
        return Read( key, val );                                            \
}
#define CONF_BIN_READ (   MVAL,
  TYPE 
)
Value:
{                                                                           \
    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 
)
Value:
{                                                                           \
    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;                                                        \
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Palomino Flight Simulator documents generated by doxygen 1.7.1 on Tue May 15 2012 22:40:10