41 #include <libxml/parser.h>
42 #include <libxml/tree.h>
44 #include <glibmm/ustring.h>
54 XMLProperty(
const std::string& n,
const std::string& v = std::string());
57 const std::string&
name()
const {
return _name; }
58 const std::string&
value()
const {
return _value; }
59 const std::string&
set_value(
const std::string& v) {
return _value = v; }
77 XMLTree(
const std::string& fn,
bool validate =
false);
84 const std::string&
filename()
const {
return _filename; }
85 const std::string&
set_filename(
const std::string& fn) {
return _filename = fn; }
90 bool read() {
return read_internal(
false); }
91 bool read(
const std::string& fn) { set_filename(fn);
return read_internal(
false); }
93 bool read_and_validate(
const std::string& fn) { set_filename(fn);
return read_internal(
true); }
97 bool write(
const std::string& fn) { set_filename(fn);
return write(); }
103 std::shared_ptr<XMLSharedNodeList>
find(
const std::string xpath,
XMLNode* = 0)
const;
126 const std::string&
name()
const {
return _name; }
129 const std::string&
content()
const {
return _content; }
154 return set_property (
name, std::string(cstr));
159 return set_property (
name, ustr.raw ());
166 if (!PBD::to_string<T> (value, str)) {
169 return set_property(
name, str);
182 return PBD::string_to<T> (prop->
value (), value);
197 void dump (std::ostream &, std::string p =
"")
const;
215 virtual const char*
what()
const throw() {
return _message.c_str(); }
XMLException(const std::string msg)
virtual const char * what() const
bool has_property_with_value(const std::string &, const std::string &) const
XMLNode(const XMLNode &other)
const std::string & child_content() const
void remove_nodes_and_delete(const std::string &propname, const std::string &val)
const XMLNodeList & children(const std::string &str=std::string()) const
const std::string & name() const
void remove_node_and_delete(const std::string &n, const std::string &propname, const std::string &val)
const std::string & content() const
bool set_property(const char *name, const char *cstr)
XMLNode(const std::string &name, const std::string &content)
void remove_property_recursively(const std::string &)
bool set_property(const char *name, const std::string &value)
void dump(std::ostream &, std::string p="") const
XMLNode(const std::string &name)
XMLPropertyList _proplist
bool set_property(const char *name, const T &value)
XMLProperty const * property(const char *) const
void remove_nodes_and_delete(const std::string &)
bool get_property(const char *name, std::string &value) const
XMLNode * child(const char *) const
const std::string & set_content(const std::string &)
XMLProperty const * property(const std::string &) const
void remove_property(const std::string &)
void add_child_nocopy(XMLNode &)
XMLNode * add_child_copy(const XMLNode &)
XMLProperty * property(const std::string &)
bool set_property(const char *name, const Glib::ustring &ustr)
void remove_nodes(const std::string &)
XMLProperty * property(const char *)
const XMLPropertyList & properties() const
std::string attribute_value()
XMLNodeList _selected_children
XMLNode * add_content(const std::string &s=std::string())
bool get_property(const char *name, T &value) const
XMLNode * add_child(const char *)
const std::string & name() const
const std::string & value() const
XMLProperty(const std::string &n, const std::string &v=std::string())
const std::string & set_value(const std::string &v)
XMLTree(const std::string &fn, bool validate=false)
bool read_and_validate(const std::string &fn)
bool read_buffer(char const *, bool to_tree_doc=false)
bool write(const std::string &fn)
const std::string & write_buffer() const
bool read_internal(bool validate)
const std::string & set_filename(const std::string &fn)
std::shared_ptr< XMLSharedNodeList > find(const std::string xpath, XMLNode *=0) const
const std::string & filename() const
bool read(const std::string &fn)
XMLNode * set_root(XMLNode *n)
GtkImageIconNameData name
GTKMM_API const Gtk::BuiltinStockID FILE
bool operator==(const ProcessorSelection &a, const ProcessorSelection &b)
std::vector< XMLProperty * > XMLPropertyList
XMLPropertyList::iterator XMLPropertyIterator
std::vector< std::shared_ptr< XMLNode > > XMLSharedNodeList
XMLNodeList::iterator XMLNodeIterator
XMLPropertyList::const_iterator XMLPropertyConstIterator
std::vector< XMLNode * > XMLNodeList
XMLNodeList::const_iterator XMLNodeConstIterator