diff options
Diffstat (limited to 'src/Config.cpp')
-rw-r--r-- | src/Config.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/Config.cpp b/src/Config.cpp index 3a3cb53..d860638 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -37,6 +37,9 @@ $Id$ #include "astra/Projector2D.h" #include "astra/Projector3D.h" +#include "astra/Logging.h" +#include <sstream> + using namespace astra; using namespace std; @@ -54,12 +57,24 @@ Config::Config(XMLNode* _self) self = _self; } +//----------------------------------------------------------------------------- Config::~Config() { delete self; self = 0; } +//----------------------------------------------------------------------------- +void Config::initialize(std::string rootname) +{ + if (self == 0) { + XMLDocument* doc = XMLDocument::createDocument(rootname); + self = doc->getRootNode(); + } +} + + +//----------------------------------------------------------------------------- template <class T> ConfigStackCheck<T>::ConfigStackCheck(const char *_name, T* _obj, const Config& _cfg) : object(_obj), cfg(&_cfg), name(_name) @@ -132,7 +147,9 @@ bool ConfigStackCheck<T>::stopParsing() nodes.clear(); if (!errors.empty()) { - cout << "Warning: " << name << ": unused configuration options: " << errors << std::endl; + ostringstream os; + os << name << ": unused configuration options: " << errors; + ASTRA_WARN(os.str().c_str()); return false; } |