Scopira
20080306
|
#include <xml.h>
Public Member Functions | |
xml_doc (void) | |
ctor, creates a NULL doc, you should parse or init one More... | |
~xml_doc () | |
Destructor. | |
xmlDocPtr | get_ptr (void) const |
returns the internal pointer – use with care | |
bool | is_null (void) const |
bool | is_valid (void) const |
const char * | get_c_name (void) const |
std::string | get_name (void) const |
void | clear (void) |
void | init (const std::string &rootnodename) |
void | add_pi (const std::string &name, const std::string &content="") |
void | load_ptr (xmlDocPtr newdoc) |
bool | load_file (const std::string &filename) |
bool | load_string (const std::string &data) |
bool | load_c_str (const char *str) |
void | load_prop (property *p) |
xml_node | get_root (void) const |
bool | save_file (const std::string &filename, bool compress=false) const |
bool | save_string (std::string &out) const |
void | save_prop (property *p) const |
Public Member Functions inherited from scopira::tool::object | |
virtual | ~object () |
int | add_ref (void) const |
bool | sub_ref (void) const |
void | auto_ref (void) const |
int | current_ref (void) const |
virtual scopira::tool::oflow_i & | print (scopira::tool::oflow_i &o) const |
virtual bool | load (scopira::tool::iobjflow_i &in) |
virtual void | save (scopira::tool::oobjflow_i &out) const |
bool | is_alive_object (void) const |
bool | is_dead_object (void) const |
Additional Inherited Members | |
Protected Member Functions inherited from scopira::tool::object | |
object (void) | |
object (bool neverusecounter) | |
An XML document. Not copyable.
|
inline |
ctor, creates a NULL doc, you should parse or init one
Constructs an empty document. You must then call one of the init or load routines.
Referenced by get_name().
void scopira::tool::xml_doc::add_pi | ( | const std::string & | name, |
const std::string & | content = "" |
||
) |
Adds a new processing instruction (PI) to the doc.
Referenced by get_name().
void scopira::tool::xml_doc::clear | ( | void | ) |
Clear and free any internal data
Referenced by get_name(), and ~xml_doc().
|
inline |
Gets the name of this document as a C string
|
inline |
Gets the name of this document
References add_pi(), clear(), get_root(), init(), load_c_str(), load_file(), load_prop(), load_ptr(), load_string(), save_file(), save_prop(), save_string(), and xml_doc().
xml_node scopira::tool::xml_doc::get_root | ( | void | ) | const |
Gets the root node.
Referenced by get_name().
void scopira::tool::xml_doc::init | ( | const std::string & | rootnodename | ) |
Constructs a new blank documement with the given root node name
Referenced by get_name().
|
inline |
Is this an empty doc?
|
inline |
Is this doc not-empty (valid)?
bool scopira::tool::xml_doc::load_c_str | ( | const char * | str | ) |
Loads/parses a document from an in memory (C) string
data | the input string |
Referenced by get_name().
bool scopira::tool::xml_doc::load_file | ( | const std::string & | filename | ) |
Load a document from the given file. Will be decompressed if need be.
filename | the file to load from. |
Referenced by get_name().
void scopira::tool::xml_doc::load_prop | ( | property * | p | ) |
void scopira::tool::xml_doc::load_ptr | ( | xmlDocPtr | newdoc | ) |
Replacements the current doc with the supplied one – use with care. The current doc, if any, will be released. The new doc may be null.
newdoc | the new doc |
Referenced by get_name().
bool scopira::tool::xml_doc::load_string | ( | const std::string & | data | ) |
Loads/parses a document from an in memory string
data | the input string |
Referenced by get_name().
bool scopira::tool::xml_doc::save_file | ( | const std::string & | filename, |
bool | compress = false |
||
) | const |
Save the current document to file
filename | the file to write out to |
compress | should the output file be compressed (default = false) |
Referenced by get_name().
void scopira::tool::xml_doc::save_prop | ( | property * | p | ) | const |
Saves this document to a property structure
p | the structure to write out to |
Referenced by get_name().
bool scopira::tool::xml_doc::save_string | ( | std::string & | out | ) | const |
Saves the current document to the given output string
out | the string to write to |
Referenced by get_name().