ManaPlus
|
#include <libxml.h>
Public Member Functions | |
Document (const std::string &filename, const UseVirtFs useResman, const SkipError skipError) | |
Document (const char *const data, const int size) | |
~Document () | |
xmlNodePtr | rootNode () |
bool | isLoaded () const |
bool | isValid () const |
Public Member Functions inherited from Resource | |
Resource () | |
~Resource () | |
virtual void | incRef () |
virtual void | decRef () |
int | calcMemoryLocal () const |
std::string | getCounterName () const |
Public Member Functions inherited from MemoryCounter | |
MemoryCounter () | |
virtual | ~MemoryCounter () |
int | calcMemory (const int level) const |
virtual int | calcMemoryChilds (const int level) const |
Static Public Member Functions | |
static bool | validateXml (const std::string &fileName) |
Private Attributes | |
xmlDocPtr | mDoc |
bool | mIsValid |
Additional Inherited Members | |
Data Fields inherited from Resource | |
time_t | mTimeStamp |
std::string | mIdPath |
std::string | mSource |
unsigned int | mRefCount |
bool | mProtected |
bool | mNotCount |
A helper class for parsing an XML document, which also cleans it up again (RAII).
XML::Document::Document | ( | const std::string & | filename, |
const UseVirtFs | useResman, | ||
const SkipError | skipError | ||
) |
Constructor that attempts to load the given file through the resource manager. Logs errors.
Definition at line 87 of file libxml.cpp.
References BLOCK_END, BLOCK_START, CAST_S32, data, VirtFs::loadFile(), mDoc, mIsValid, reportAlways, EmoteDB::size(), SkipError_false, UseVirtFs_true, and anonymous_namespace{libxml.cpp}::valid.
XML::Document::Document | ( | const char *const | data, |
const int | size | ||
) |
Constructor that attempts to load an XML document from memory. Does not log errors.
data | the string to parse as XML |
size | the length of the string in bytes |
Definition at line 157 of file libxml.cpp.
XML::Document::~Document | ( | ) |
|
inline |
|
inline |
xmlNodePtr XML::Document::rootNode | ( | ) |
Returns the root node of the document (or NULL if there was a load error).
Definition at line 169 of file libxml.cpp.
References mDoc.
Referenced by Particle::addEffect(), ParticleEngine::addEffect(), MapReader::addLayerToList(), EquipmentWindow::fillBoxes(), SpriteDef::includeSprite(), Configuration::init(), CharDB::load(), SpriteDef::load(), ColorDB::loadColorLists(), Theme::loadColors(), ColorDB::loadHair(), MapDB::loadInfo(), Theme::loadInfo(), MapDB::loadRemapXmlFile(), ServerDialog::loadServers(), EmoteDB::loadSpecialXmlFile(), loadXMLFile(), EffectManager::loadXmlFile(), SkillDialog::loadXmlFile(), AvatarDB::loadXmlFile(), ClanDb::loadXmlFile(), CommandsDB::loadXmlFile(), DeadDB::loadXmlFile(), ElementalDb::loadXmlFile(), EmoteDB::loadXmlFile(), GroupDb::loadXmlFile(), HomunculusDB::loadXmlFile(), HorseDB::loadXmlFile(), ItemFieldDb::loadXmlFile(), ItemOptionDb::loadXmlFile(), LanguageDb::loadXmlFile(), MercenaryDB::loadXmlFile(), ModDB::loadXmlFile(), MonsterDB::loadXmlFile(), NPCDB::loadXmlFile(), NpcDialogDB::loadXmlFile(), PETDB::loadXmlFile(), QuestDb::loadXmlFile(), SkillUnitDb::loadXmlFile(), SoundDB::loadXmlFile(), StatDb::loadXmlFile(), StatusEffectDB::loadXmlFile(), TextDb::loadXmlFile(), UnitsDb::loadXmlFile(), ItemDB::loadXmlFile(), EquipmentWindow::prepareSlotNames(), Theme::readSkin(), MapReader::readTileset(), readXmlIntMap(), readXmlIntVector(), readXmlStringMap(), and Configuration::reInit().
|
static |
Definition at line 320 of file libxml.cpp.
References fileName, and strStartWith().
Referenced by Net::Download::downloadThread().
|
private |
Definition at line 95 of file libxml.h.
Referenced by Document(), isLoaded(), rootNode(), and ~Document().
|
private |
Definition at line 96 of file libxml.h.
Referenced by Document(), and isValid().