4 #ifndef DMLITE_CPP_UTILS_EXTENSIBLE_H
5 #define DMLITE_CPP_UTILS_EXTENSIBLE_H
8 #include <boost/any.hpp>
9 #include <boost/property_tree/ptree.hpp>
26 void populate(
const boost::property_tree::ptree& root);
34 static long anyToLong (
const boost::any& any);
38 static std::string
anyToString (
const boost::any& any);
40 static int64_t
anyToS64 (
const boost::any& any);
42 static uint64_t
anyToU64 (
const boost::any& any);
45 bool hasField(
const std::string& key)
const;
62 unsigned long size()
const;
72 void erase(
const std::string&);
84 bool getBool(const std::
string& key,
bool defaultValue = false) const throw (DmException);
87 long getLong(const std::
string& key,
long defaultValue = 0) const throw (DmException);
90 unsigned long getUnsigned(const std::
string& key,
unsigned long defaultValue = 0) const throw (DmException);
93 double getDouble(const std::
string& key,
double defaultValue = 0) const throw (DmException);
96 int64_t
getS64(const std::
string& key, int64_t defaultValue = 0) const throw (DmException);
99 uint64_t
getU64(const std::
string& key, uint64_t defaultValue = 0) const throw (DmException);
102 std::
string getString(const std::
string& key, const std::
string& defaultValue = "") const throw (DmException);
109 std::vector<boost::any>
getVector(const std::
string& key,
110 const std::vector<boost::any>& defaultValue = std::vector<boost::any>()) const throw (DmException);
121 #endif // DMLITE_CPP_UTILS_TYPES_H