71 const std::string& version,
72 const std::string& encoding,
73 const std::string& standalone) :
GXmlNode()
212 for (
int i = 0; i <
m_nodes.size(); ++i) {
213 m_nodes[i]->write(url, indent);
229 const int& indent)
const
241 result.append(
"GXmlDocument::");
242 result.append(
"version=\"" +
version() +
"\"");
243 result.append(
" encoding=\"" +
encoding() +
"\"");
244 result.append(
" standalone=\"" +
standalone() +
"\"");
247 for (
int i = 0; i <
m_nodes.size(); ++i) {
248 result.append(
"\n" +
m_nodes[i]->
print(chatter, indent));
XML document node class interface definition.
void clear(void)
Clear file name.
virtual void printf(const char *format,...)=0
const std::string & value(void) const
Return attribute value.
void write(GUrl &url) const
Write attribute into URL.
const std::string & name(void) const
Return attribute name.
void clear(void)
Clear element attribute.
GFilename m_filename
Name of XML file.
std::string encoding(void) const
Return encoding.
virtual void clear(void)
Clear XML document.
GXmlAttribute m_standalone
Standalone ("yes", "no")
void copy_members(const GXmlDocument &node)
Copy class members.
virtual ~GXmlDocument(void)
Destructor.
virtual std::string print(const GChatter &chatter=NORMAL, const int &indent=0) const
Print XML document.
GXmlAttribute m_encoding
Encoding (e.g. "UTF-8")
std::string version(void) const
Return version.
virtual GXmlDocument * clone(void) const
Clone XML document.
void free_members(void)
Delete class members.
virtual void write(GUrl &url, const int &indent=0) const
Write XML document into URL.
std::string standalone(void) const
Return standalone.
const GFilename & filename(void) const
Return filename.
void init_members(void)
Initialise class members.
GXmlAttribute m_version
XML version ("1.0", "1.1")
GXmlDocument(void)
Void constructor.
GXmlDocument & operator=(const GXmlDocument &node)
Assignment operator.
Abstract XML node base class.
GXmlNode & operator=(const GXmlNode &node)
Assignment operator.
std::vector< GXmlNode * > m_nodes
Pointer to child nodes.
void free_members(void)
Delete class members.
void init_members(void)
Initialise class members.
std::string fill(const std::string &s, const int &n)
Fill string with n strings of same type.