4 #ifndef DMLITE_CPP_UTILS_EXTENSIBLE_H
5 #define DMLITE_CPP_UTILS_EXTENSIBLE_H
7 #include <boost/any.hpp>
8 #include <boost/property_tree/ptree.hpp>
25 void populate(
const boost::property_tree::ptree& root);
33 static long anyToLong (
const boost::any& any);
37 static std::string
anyToString (
const boost::any& any);
40 bool hasField(
const std::string& key)
const;
57 unsigned long size()
const;
66 void erase(
const std::string&);
78 bool getBool(const std::
string& key,
bool defaultValue = false) const throw (DmException);
81 long getLong(const std::
string& key,
long defaultValue = 0) const throw (DmException);
84 unsigned long getUnsigned(const std::
string& key,
unsigned long defaultValue = 0) const throw (DmException);
87 double getDouble(const std::
string& key,
double defaultValue = 0) const throw (DmException);
90 std::
string getString(const std::
string& key, const std::
string& defaultValue = "") const throw (DmException);
97 std::vector<boost::any>
getVector(const std::
string& key,
98 const std::vector<boost::any>& defaultValue = std::vector<boost::any>()) const throw (DmException);
109 #endif // DMLITE_CPP_UTILS_TYPES_H