liballofw
Classes | Public Member Functions | Static Public Member Functions | List of all members
allofw::Configuration Class Referenceabstract

YAML-based configuration reader. More...

#include <config.h>

Classes

class  Node
 Config node. More...
 

Public Member Functions

virtual NodegetNode (const char *key)=0
 Get a node with a key (pair with destroyNode). More...
 
virtual void destroyNode (Node *node)=0
 Destroy the node. More...
 
virtual void getString (const char *path, char *output, size_t output_capacity, const char *fallback="")=0
 Get the string at a given path. More...
 
virtual size_t getStringLength (const char *path, const char *fallback="")=0
 Get the length of the string at a give path. More...
 
virtual int getInt32 (const char *path, int fallback=0)=0
 Get int32 at a given path. More...
 
virtual unsigned int getUInt32 (const char *path, unsigned int fallback=0)=0
 Get uint32 at a given path. More...
 
virtual float getFloat (const char *path, float fallback=0.0f)=0
 Get float at a given path. More...
 
virtual double getDouble (const char *path, double fallback=0.0)=0
 Get double at a given path. More...
 
virtual bool getBoolean (const char *path, bool fallback=0.0)=0
 Get boolean at a given path. More...
 
virtual void parseFile (const char *path)=0
 Parse a YAML file. More...
 
virtual void parseFile (const char *path, const char *key)=0
 Parse a YAML file to a give key. More...
 
std::string getString (const char *path, const char *fallback="")
 Get STL string at a given path. More...
 
virtual ~Configuration ()
 

Static Public Member Functions

static ConfigurationCreate ()
 Create Configuration object. More...
 
static ConfigurationParseMainArgs (int argc, char *argv[])
 Create Configuration object by C++ main() arguments. More...
 
static ConfigurationCreateFromFile (const char *args=nullptr)
 Create Configuration object from file. More...
 

Detailed Description

YAML-based configuration reader.

Constructor & Destructor Documentation

virtual allofw::Configuration::~Configuration ( )
inlinevirtual

Member Function Documentation

static Configuration* allofw::Configuration::Create ( )
static

Create Configuration object.

static Configuration* allofw::Configuration::CreateFromFile ( const char *  args = nullptr)
static

Create Configuration object from file.

virtual void allofw::Configuration::destroyNode ( Node node)
pure virtual

Destroy the node.

virtual bool allofw::Configuration::getBoolean ( const char *  path,
bool  fallback = 0.0 
)
pure virtual

Get boolean at a given path.

virtual double allofw::Configuration::getDouble ( const char *  path,
double  fallback = 0.0 
)
pure virtual

Get double at a given path.

virtual float allofw::Configuration::getFloat ( const char *  path,
float  fallback = 0.0f 
)
pure virtual

Get float at a given path.

virtual int allofw::Configuration::getInt32 ( const char *  path,
int  fallback = 0 
)
pure virtual

Get int32 at a given path.

virtual Node* allofw::Configuration::getNode ( const char *  key)
pure virtual

Get a node with a key (pair with destroyNode).

virtual void allofw::Configuration::getString ( const char *  path,
char *  output,
size_t  output_capacity,
const char *  fallback = "" 
)
pure virtual

Get the string at a given path.

std::string allofw::Configuration::getString ( const char *  path,
const char *  fallback = "" 
)
inline

Get STL string at a given path.

virtual size_t allofw::Configuration::getStringLength ( const char *  path,
const char *  fallback = "" 
)
pure virtual

Get the length of the string at a give path.

virtual unsigned int allofw::Configuration::getUInt32 ( const char *  path,
unsigned int  fallback = 0 
)
pure virtual

Get uint32 at a given path.

virtual void allofw::Configuration::parseFile ( const char *  path)
pure virtual

Parse a YAML file.

virtual void allofw::Configuration::parseFile ( const char *  path,
const char *  key 
)
pure virtual

Parse a YAML file to a give key.

static Configuration* allofw::Configuration::ParseMainArgs ( int  argc,
char *  argv[] 
)
static

Create Configuration object by C++ main() arguments.


The documentation for this class was generated from the following file: