22 #include <boost/shared_ptr.hpp>
23 #include <boost/enable_shared_from_this.hpp>
37 typedef boost::shared_ptr<SDF>
SDFPtr;
56 std::string
findFile(
const std::string &_filename,
57 bool _searchLocalPath =
true,
58 bool _useCallback =
false);
64 void addURIPath(
const std::string &_uri,
const std::string &_path);
70 void setFindCallback(boost::function<std::string (
const std::string &)> _cb);
74 class Element :
public boost::enable_shared_from_this<Element>
84 public: boost::shared_ptr<Element>
Clone()
const;
101 public:
void SetName(
const std::string &_name);
105 public:
const std::string &
GetName()
const;
138 public:
void PrintWiki(std::string _prefix);
147 int _spacing,
int &_index);
155 int _spacing,
int &_index);
160 public: std::string
ToString(
const std::string &_prefix)
const;
169 const std::string &_type,
170 const std::string &_defaultvalue,
172 const std::string &_description=
"");
179 public:
void AddValue(
const std::string &_type,
180 const std::string &_defaultValue,
bool _required,
181 const std::string &_description=
"");
241 public:
template<
typename T>
242 T
Get(
const std::string &_key =
"")
246 if (_key.empty() && this->value)
247 this->value->
Get<T>(result);
248 else if (!_key.empty())
258 sdferr <<
"Unable to find value for key[" << _key <<
"]\n";
263 public:
template<
typename T>
268 this->value->
Set(_value);
274 public:
bool HasElement(
const std::string &_name)
const;
296 public:
void Reset();
298 public:
void SetInclude(
const std::string &_filename);
310 private:
void ToString(
const std::string &_prefix,
311 std::ostringstream &_out)
const;
314 private: boost::shared_ptr<Param> CreateParam(
const std::string &_key,
315 const std::string &_type,
const std::string &_defaultValue,
316 bool _required,
const std::string &_description=
"");
320 private: std::string name;
321 private: std::string required;
322 private: std::string description;
323 private:
bool copyChildren;
340 private: std::string includeFilename;
352 public:
void Write(
const std::string &_filename);
353 public: std::string
ToString()
const;