zenilib: Zeni::XML_Document Class Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | List of all members
Zeni::XML_Document Class Reference
Zenilib

A class to open an XML file and manage the root node. More...

`#include <XML.h>`

## Public Member Functions

| XML_Document ()
| XML_Document (const String &filename)
| XML_Document (const String &filename, const String &backup)
| ~XML_Document ()
void | create_root (const String &field)
| (Re)Initializes the document with a given root field More...
XML_Element_c | first () const
| Get the first subelement. More...
XML_Element | first ()
| Get the first subelement. More...
bool | good () const
void | load (const String &filename)
void | load_mem (const String &data)
XML_Element_c | operator[] (const String &field) const
| Get a named subelement. More...
XML_Element | operator[] (const String &field)
| Get a named subelement. More...
void | save ()
void | save (const String &filename)
bool | try_load (const String &filename)
bool | try_load_mem (const String &data)
bool | try_save ()
bool | try_save (const String &filename)

## Detailed Description

A class to open an XML file and manage the root node.

Author
  bazald

Contact: bazal.nosp@m.d@ze.nosp@m.nipex.nosp@m..com

Definition at line 111 of file XML.h.

## Constructor & Destructor Documentation

Zeni::XML_Document::XML_Document | ( |  | ) |

Definition at line 236 of file XML.cpp.

Zeni::XML_Document::XML_Document | ( | const String & | filename | ) |

Definition at line 241 of file XML.cpp.

References load().

Zeni::XML_Document::XML_Document | ( | const String & | filename,
|  | const String & | backup
| ) |  |

Definition at line 247 of file XML.cpp.

References load(), and try_load().

Zeni::XML_Document::~XML_Document | ( |  | ) |

Definition at line 254 of file XML.cpp.

## Member Function Documentation

void Zeni::XML_Document::create_root | ( | const String & | field | ) |

(Re)Initializes the document with a given root field

Manipulation Functions

Definition at line 386 of file XML.cpp.

References Zeni::String::c_str(), and TiXmlNode::LinkEndChild().

XML_Element_c Zeni::XML_Document::first | ( |  | ) | const

Get the first subelement.

Definition at line 368 of file XML.cpp.

References Zeni::XML_Element::first(), and good().

XML_Element Zeni::XML_Document::first | ( |  | ) |

Get the first subelement.

Definition at line 377 of file XML.cpp.

References Zeni::XML_Element::first(), and good().

bool Zeni::XML_Document::good | ( |  | ) | const

Load and Save

Definition at line 258 of file XML.cpp.

Referenced by first(), operator[](), and try_save().

void Zeni::XML_Document::load | ( | const String & | filename | ) |

Definition at line 270 of file XML.cpp.

References TiXmlDocument::ErrorDesc(), and try_load().

Referenced by Zeni::Video::save(), and XML_Document().

void Zeni::XML_Document::load_mem | ( | const String & | data | ) |

Definition at line 262 of file XML.cpp.

References TiXmlDocument::ErrorDesc(), and try_load_mem().

Referenced by Zeni::Database< TYPE >::load_file().

XML_Element_c Zeni::XML_Document::operator[] | ( | const String & | field | ) | const

Get a named subelement.

Tree Traversal

Definition at line 350 of file XML.cpp.

References good().

XML_Element Zeni::XML_Document::operator[] | ( | const String & | field | ) |

Get a named subelement.

Definition at line 359 of file XML.cpp.

References good().

void Zeni::XML_Document::save | ( |  | ) |

Definition at line 278 of file XML.cpp.

References TiXmlDocument::ErrorDesc(), and try_save().

void Zeni::XML_Document::save | ( | const String & | filename | ) |

Definition at line 286 of file XML.cpp.

References TiXmlDocument::ErrorDesc(), and try_save().

bool Zeni::XML_Document::try_load | ( | const String & | filename | ) |

Definition at line 314 of file XML.cpp.

References Zeni::String::c_str(), and TiXmlDocument::LoadFile().

Referenced by load(), load_config(), Zeni::Video::save(), and XML_Document().

bool Zeni::XML_Document::try_load_mem | ( | const String & | data | ) |

Definition at line 294 of file XML.cpp.

References Zeni::String::c_str(), TiXmlDocument::Parse(), and ZENI_LOGE().

Referenced by load_mem().

bool Zeni::XML_Document::try_save | ( |  | ) |

Definition at line 332 of file XML.cpp.

References good(), and TiXmlDocument::SaveFile().

Referenced by save(), and Zeni::Video::save().

bool Zeni::XML_Document::try_save | ( | const String & | filename | ) |

Definition at line 341 of file XML.cpp.

References Zeni::String::c_str(), good(), and TiXmlDocument::SaveFile().

The documentation for this class was generated from the following files:

- zenilib/jni/external/zenilib/zeni/Zeni/XML.h
- zenilib/jni/external/zenilib/zeni/XML.cpp