Brion  1.6.0
The Blue Brain C++ I/O library
brion::BlueConfig Class Reference

Read access to a BlueConfig or CircuitConfig file. More...

#include <blueConfig.h>

+ Inheritance diagram for brion::BlueConfig:
+ Collaboration diagram for brion::BlueConfig:

Public Member Functions

BRION_API ~BlueConfig ()
 Close BlueConfig or CircuitConfig file. More...
 
Read API
BRION_API BlueConfig (const std::string &source)
 Open given filepath to a BlueConfig or CircuitConfig for reading. More...
 
BRION_API const Strings & getSectionNames (const BlueConfigSection section) const
 Get names of given section type. More...
 
BRION_API const std::string & get (const BlueConfigSection section, const std::string &sectionName, const std::string &key) const
 Get value as string for key in given section. More...
 
template<typename T >
get (const BlueConfigSection section, const std::string &sectionName, const std::string &key) const
 Get value as type T for key in given section. More...
 

Friends

std::ostream & operator<< (std::ostream &, const BlueConfig &)
 Stream out content of BlueConfig or CircuitConfig file. More...
 

Detailed Description

Read access to a BlueConfig or CircuitConfig file.

Following RAII, this class is ready to use after the creation and will ensure release of resources upon destruction.

Definition at line 39 of file blueConfig.h.

Constructor & Destructor Documentation

BRION_API brion::BlueConfig::~BlueConfig ( )

Close BlueConfig or CircuitConfig file.

Version
1.0
BRION_API brion::BlueConfig::BlueConfig ( const std::string &  source)
explicit

Open given filepath to a BlueConfig or CircuitConfig for reading.

Parameters
sourcefilepath to BlueConfig or CircuitConfig file
Exceptions
std::runtime_errorif source is not a valid BlueConfig or CircuitConfig file
Version
1.0

Member Function Documentation

BRION_API const std::string& brion::BlueConfig::get ( const BlueConfigSection  section,
const std::string &  sectionName,
const std::string &  key 
) const

Get value as string for key in given section.

Parameters
sectiontype of section to get the value from
sectionNamename of section to get the value from
keyname of the key to the value from
Returns
value as string of the given section & key, empty if not found
Version
1.0
template<typename T >
T brion::BlueConfig::get ( const BlueConfigSection  section,
const std::string &  sectionName,
const std::string &  key 
) const
inline

Get value as type T for key in given section.

Parameters
sectiontype of section to get the value from
sectionNamename of section to get the value from
keyname of the key to the value from
Returns
value as type T of the given section & key
Exceptions
boost::bad_lexical_castif value cannot be casted to type T
Version
1.0

Definition at line 87 of file blueConfig.h.

BRION_API const Strings& brion::BlueConfig::getSectionNames ( const BlueConfigSection  section) const

Get names of given section type.

Parameters
sectiontype of section to get their names from
Returns
names of sections matching the query type
Version
1.0

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ,
const BlueConfig  
)
friend

Stream out content of BlueConfig or CircuitConfig file.


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