diff --git a/src/common/Config/XMLConfig.cpp b/src/common/Config/XMLConfig.cpp deleted file mode 100644 index a28d8dfa..00000000 --- a/src/common/Config/XMLConfig.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "XMLConfig.h" -#include -#include -#include -#include -#include -#include - -namespace Core { - // instanciate and load a config - XMLConfig::XMLConfig() - { - - } - - XMLConfig::~XMLConfig() - { - - } - - using boost::property_tree::ptree; - const ptree& empty_ptree() - { - static ptree t; - return t; - }; - - bool XMLConfig::loadConfig( const std::string& fileName ) - { - - boost::property_tree::read_xml( fileName, m_propTree ); - return true; - } - -} diff --git a/src/common/Config/XMLConfig.h b/src/common/Config/XMLConfig.h deleted file mode 100644 index cf9395b2..00000000 --- a/src/common/Config/XMLConfig.h +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef __XMLCONFIG_H -#define __XMLCONFIG_H - -#include - -#include - -#include - -namespace Core { - - // very simple XML parser class - // this hasn't gotten much attention yet as it works good as it is. - class XMLConfig - { - public: - typedef std::map SettingMap; - typedef std::map CategoryMap; - - // instanciate and load a config - XMLConfig(); - - ~XMLConfig(); - - // load a config file - bool loadConfig( const std::string& fileName ); - - template< class T > - T getValue( const std::string& name, T defaultValue = T() ) - { - try - { - return m_propTree.get< T >( name ); - } - catch( ... ) - { - return defaultValue; - } - } - - template< class T > - void setValue( const std::string& name, T defaultValue = T() ) - { - m_propTree.put( name, defaultValue ); - } - - template< class T > - T getAttrValue( boost::property_tree::ptree node, const std::string& name, T defaultValue = T() ) - { - try - { - T outVal = node.get< T >( "." + name ); - return outVal; - } - catch( const std::runtime_error& ) - { - T outVal = defaultValue; - return outVal; - } - } - - boost::property_tree::ptree getChild( const std::string& name ) - { - auto val = m_propTree.get_child( name ); - return val; - } - - private: - boost::property_tree::ptree m_propTree; - }; - -} -#endif