Image Component Library (ICL)
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
icl::utils::ConfigFile::Data Class Reference

Data- type used for the []-operator of ConfigFile instances. More...

#include <ConfigFile.h>

Public Member Functions

template<class T >
 operator T () const
 automatic cast operator (lvalue type determines T) More...
 
template<class T >
as () const
 explicit cast into given type More...
 
Dataoperator= (const Data &d)
 special assignment for data instances More...
 
template<class T >
Dataoperator= (const T &t)
 mutlti class assignment operator More...
 

Private Member Functions

 Data (const std::string &id, ConfigFile &cf)
 private constructor More...
 

Private Attributes

std::string id
 internal id (config.foo.bar) More...
 
ConfigFilecf
 parent config file More...
 

Friends

class ConfigFile
 for tight integration with parent ConfigFile class More...
 

Detailed Description

Data- type used for the []-operator of ConfigFile instances.

See also
Data ConfigFile::operator[](const std::string &id)

Constructor & Destructor Documentation

◆ Data()

icl::utils::ConfigFile::Data::Data ( const std::string &  id,
ConfigFile cf 
)
private

private constructor

Member Function Documentation

◆ as()

template<class T >
T icl::utils::ConfigFile::Data::as ( ) const
inline

explicit cast into given type

Sometimes, the implicit automatic cast is not allowed due to ambiguities

◆ operator T()

template<class T >
icl::utils::ConfigFile::Data::operator T ( ) const
inline

automatic cast operator (lvalue type determines T)

This automatic cast automatically detects the destination (lvalue) type an calls the appropiate parse<T> function

◆ operator=() [1/2]

Data& icl::utils::ConfigFile::Data::operator= ( const Data d)
inline

special assignment for data instances

This does just copy the data-reference, not it's referenced value

◆ operator=() [2/2]

template<class T >
Data& icl::utils::ConfigFile::Data::operator= ( const T &  t)
inline

mutlti class assignment operator

assigns a string representation of given T instance to the according ConfigFile Entry T to string conversion is performed using std::string utils str- function, which internally exploits the std::ostream operator<< for given T instance. If given type T is not registered, an UnregisteredTypeException is thrown

Friends And Related Function Documentation

◆ ConfigFile

friend class ConfigFile
friend

for tight integration with parent ConfigFile class

Member Data Documentation

◆ cf

ConfigFile* icl::utils::ConfigFile::Data::cf
private

parent config file

◆ id

std::string icl::utils::ConfigFile::Data::id
private

internal id (config.foo.bar)


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