diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-07 17:35:02 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-07 17:35:02 +0300 |
commit | 328eaa8ded37e86f2575cb2804d1aaa36cdd4a1b (patch) | |
tree | 76f605440589ba9a9da29e46f9f7a5a951016263 /src | |
parent | 664131c51126d33e6e1fca7d9da09bc67016e450 (diff) | |
download | manaverse-328eaa8ded37e86f2575cb2804d1aaa36cdd4a1b.tar.gz manaverse-328eaa8ded37e86f2575cb2804d1aaa36cdd4a1b.tar.bz2 manaverse-328eaa8ded37e86f2575cb2804d1aaa36cdd4a1b.tar.xz manaverse-328eaa8ded37e86f2575cb2804d1aaa36cdd4a1b.zip |
Remove optional parameter from xml document constructor.
Diffstat (limited to 'src')
27 files changed, 37 insertions, 35 deletions
diff --git a/src/effectmanager.cpp b/src/effectmanager.cpp index 52e116171..a390e3707 100644 --- a/src/effectmanager.cpp +++ b/src/effectmanager.cpp @@ -47,7 +47,7 @@ EffectManager::EffectManager() : void EffectManager::loadXmlFile(const std::string &fileName) { - XML::Document doc(fileName); + XML::Document doc(fileName, true); const XmlNodePtrConst root = doc.rootNode(); if (!root || !xmlNameEqual(root, "being-effects")) diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index 9898aebfc..98db5dc4c 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -373,7 +373,7 @@ Skin *Theme::readSkin(const std::string &filename, const bool full) // logger->log("Loading skin '%s'.", filename.c_str()); - XML::Document doc(resolveThemePath(filename)); + XML::Document doc(resolveThemePath(filename), true); const XmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "skinset")) @@ -967,7 +967,7 @@ void Theme::loadColors(std::string file) else file.append("/colors.xml"); - XML::Document doc(resolveThemePath(file)); + XML::Document doc(resolveThemePath(file), true); const XmlNodePtrConst root = doc.rootNode(); if (!root || !xmlNameEqual(root, "colors")) @@ -1156,7 +1156,7 @@ ThemeInfo *Theme::loadInfo(const std::string &themeName) themeName).append("/info.xml"); } logger->log("loading: " + path); - XML::Document doc(path); + XML::Document doc(path, true); const XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "info")) diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index 6bec6dfa3..f5403449f 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -571,7 +571,8 @@ void EquipmentWindow::resetBeing(const Being *const being) void EquipmentWindow::fillBoxes() { XML::Document *const doc = new XML::Document( - paths.getStringValue("equipmentWindowFile")); + paths.getStringValue("equipmentWindowFile"), + true); const XmlNodePtr root = doc->rootNode(); if (!root) { diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp index 3af243970..370d6257d 100644 --- a/src/gui/windows/questswindow.cpp +++ b/src/gui/windows/questswindow.cpp @@ -166,7 +166,7 @@ QuestsWindow::~QuestsWindow() void QuestsWindow::loadXmlFile(const std::string &fileName) { - XML::Document doc(fileName); + XML::Document doc(fileName, true); const XmlNodePtrConst root = doc.rootNode(); if (!root) return; diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index 297bc0049..14261a70a 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -264,7 +264,7 @@ void SkillDialog::loadSkills() void SkillDialog::loadXmlFile(const std::string &fileName) { - XML::Document doc(fileName); + XML::Document doc(fileName, true); XmlNodePtrConst root = doc.rootNode(); int setCount = 0; diff --git a/src/particle/particle.cpp b/src/particle/particle.cpp index 241ac634b..c0bd275e1 100644 --- a/src/particle/particle.cpp +++ b/src/particle/particle.cpp @@ -292,7 +292,7 @@ Particle *Particle::addEffect(const std::string &particleEffectFile, const size_t pos = particleEffectFile.find('|'); const std::string dyePalettes = (pos != std::string::npos) ? particleEffectFile.substr(pos + 1) : ""; - XML::Document doc(particleEffectFile.substr(0, pos)); + XML::Document doc(particleEffectFile.substr(0, pos), true); const XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "effect")) diff --git a/src/resources/db/avatardb.cpp b/src/resources/db/avatardb.cpp index 5f90d9884..c01eff88b 100644 --- a/src/resources/db/avatardb.cpp +++ b/src/resources/db/avatardb.cpp @@ -52,7 +52,7 @@ void AvatarDB::load() void AvatarDB::loadXmlFile(const std::string &fileName) { - XML::Document doc(fileName); + XML::Document doc(fileName, true); const XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "avatars")) diff --git a/src/resources/db/chardb.cpp b/src/resources/db/chardb.cpp index 2fab004ad..15810596b 100644 --- a/src/resources/db/chardb.cpp +++ b/src/resources/db/chardb.cpp @@ -49,7 +49,8 @@ void CharDB::load() unload(); XML::Document *doc = new XML::Document( - paths.getStringValue("charCreationFile")); + paths.getStringValue("charCreationFile"), + true); const XmlNodePtrConst root = doc->rootNode(); if (!root || !xmlNameEqual(root, "chars")) diff --git a/src/resources/db/colordb.cpp b/src/resources/db/colordb.cpp index 67ad9402b..ff4833f2c 100644 --- a/src/resources/db/colordb.cpp +++ b/src/resources/db/colordb.cpp @@ -72,7 +72,7 @@ void ColorDB::load() void ColorDB::loadHair(const std::string &fileName, std::map<int, ItemColor> &colors) { - XML::Document *doc = new XML::Document(fileName); + XML::Document *doc = new XML::Document(fileName, true); const XmlNodePtrConst root = doc->rootNode(); if (!root || !xmlNameEqual(root, "colors")) @@ -110,7 +110,7 @@ void ColorDB::loadHair(const std::string &fileName, void ColorDB::loadColorLists(const std::string &fileName) { - XML::Document *doc = new XML::Document(fileName); + XML::Document *doc = new XML::Document(fileName, true); const XmlNodePtrConst root = doc->rootNode(); if (!root) { diff --git a/src/resources/db/commandsdb.cpp b/src/resources/db/commandsdb.cpp index 6933fb0f4..f1c177916 100644 --- a/src/resources/db/commandsdb.cpp +++ b/src/resources/db/commandsdb.cpp @@ -58,7 +58,7 @@ static SpellTarget parseTarget(const std::string &text) void CommandsDB::loadXmlFile(const std::string &fileName) { - XML::Document doc(fileName); + XML::Document doc(fileName, true); const XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "commands")) diff --git a/src/resources/db/deaddb.cpp b/src/resources/db/deaddb.cpp index 962cc7f8d..45bc77478 100644 --- a/src/resources/db/deaddb.cpp +++ b/src/resources/db/deaddb.cpp @@ -48,7 +48,7 @@ void DeadDB::load() void DeadDB::loadXmlFile(const std::string &fileName) { - XML::Document *doc = new XML::Document(fileName); + XML::Document *doc = new XML::Document(fileName, true); const XmlNodePtrConst root = doc->rootNode(); if (!root || !xmlNameEqual(root, "messages")) diff --git a/src/resources/db/emotedb.cpp b/src/resources/db/emotedb.cpp index a27547db0..f527a9624 100644 --- a/src/resources/db/emotedb.cpp +++ b/src/resources/db/emotedb.cpp @@ -67,7 +67,7 @@ void EmoteDB::load() void EmoteDB::loadXmlFile(const std::string &fileName) { - XML::Document doc(fileName); + XML::Document doc(fileName, true); XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "emotes")) @@ -143,7 +143,7 @@ void EmoteDB::loadXmlFile(const std::string &fileName) void EmoteDB::loadSpecialXmlFile(const std::string &fileName) { - XML::Document doc(fileName); + XML::Document doc(fileName, true); XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "emotes")) diff --git a/src/resources/db/homunculusdb.cpp b/src/resources/db/homunculusdb.cpp index 2c6cf26f3..e5337f8c3 100644 --- a/src/resources/db/homunculusdb.cpp +++ b/src/resources/db/homunculusdb.cpp @@ -56,7 +56,7 @@ void HomunculusDB::load() void HomunculusDB::loadXmlFile(const std::string &fileName) { - XML::Document doc(fileName); + XML::Document doc(fileName, true); const XmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "homunculuses")) diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp index 1b4296ad6..ba072f62a 100644 --- a/src/resources/db/itemdb.cpp +++ b/src/resources/db/itemdb.cpp @@ -234,7 +234,7 @@ void ItemDB::load() void ItemDB::loadXmlFile(const std::string &fileName, int &tagNum) { - XML::Document doc(fileName); + XML::Document doc(fileName, true); const XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "items")) diff --git a/src/resources/db/mapdb.cpp b/src/resources/db/mapdb.cpp index fded39825..1a419bf9d 100644 --- a/src/resources/db/mapdb.cpp +++ b/src/resources/db/mapdb.cpp @@ -59,7 +59,7 @@ void MapDB::load() void MapDB::loadRemapXmlFile(const std::string &fileName) { - XML::Document *const doc = new XML::Document(fileName); + XML::Document *const doc = new XML::Document(fileName, true); const XmlNodePtrConst root = doc->rootNode(); if (!root) @@ -140,7 +140,7 @@ void MapDB::readAtlas(XmlNodePtrConst node) void MapDB::loadInfo(const std::string &fileName) { - XML::Document *doc = new XML::Document(fileName); + XML::Document *doc = new XML::Document(fileName, true); const XmlNodePtrConst root = doc->rootNode(); if (!root) { diff --git a/src/resources/db/mercenarydb.cpp b/src/resources/db/mercenarydb.cpp index a12a86a42..5ce60f131 100644 --- a/src/resources/db/mercenarydb.cpp +++ b/src/resources/db/mercenarydb.cpp @@ -56,7 +56,7 @@ void MercenaryDB::load() void MercenaryDB::loadXmlFile(const std::string &fileName) { - XML::Document doc(fileName); + XML::Document doc(fileName, true); const XmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "mercenaries")) diff --git a/src/resources/db/moddb.cpp b/src/resources/db/moddb.cpp index af4c5ad32..81fc1e428 100644 --- a/src/resources/db/moddb.cpp +++ b/src/resources/db/moddb.cpp @@ -50,7 +50,7 @@ void ModDB::load() void ModDB::loadXmlFile(const std::string &fileName) { - XML::Document doc(fileName); + XML::Document doc(fileName, true); const XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "mods")) diff --git a/src/resources/db/monsterdb.cpp b/src/resources/db/monsterdb.cpp index ed94a3db9..7d6fe30b2 100644 --- a/src/resources/db/monsterdb.cpp +++ b/src/resources/db/monsterdb.cpp @@ -59,7 +59,7 @@ void MonsterDB::load() void MonsterDB::loadXmlFile(const std::string &fileName) { - XML::Document doc(fileName); + XML::Document doc(fileName, true); const XmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "monsters")) diff --git a/src/resources/db/npcdb.cpp b/src/resources/db/npcdb.cpp index 3048fb317..079bbe4c8 100644 --- a/src/resources/db/npcdb.cpp +++ b/src/resources/db/npcdb.cpp @@ -56,7 +56,7 @@ void NPCDB::load() void NPCDB::loadXmlFile(const std::string &fileName) { - XML::Document doc(fileName); + XML::Document doc(fileName, true); const XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "npcs")) diff --git a/src/resources/db/petdb.cpp b/src/resources/db/petdb.cpp index 6f283f1aa..c89725a17 100644 --- a/src/resources/db/petdb.cpp +++ b/src/resources/db/petdb.cpp @@ -54,7 +54,7 @@ void PETDB::load() void PETDB::loadXmlFile(const std::string &fileName) { - XML::Document doc(fileName); + XML::Document doc(fileName, true); const XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "pets")) diff --git a/src/resources/db/sounddb.cpp b/src/resources/db/sounddb.cpp index 69c3acad1..c6e5bcb8a 100644 --- a/src/resources/db/sounddb.cpp +++ b/src/resources/db/sounddb.cpp @@ -44,7 +44,7 @@ void SoundDB::load() void SoundDB::loadXmlFile(const std::string &fileName) { - XML::Document *doc = new XML::Document(fileName); + XML::Document *doc = new XML::Document(fileName, true); const XmlNodePtrConst root = doc->rootNode(); if (!root || !xmlNameEqual(root, "sounds")) diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index c2ccd9dc5..9c19419e3 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -203,7 +203,7 @@ int inflateMemory(unsigned char *restrict const in, void MapReader::addLayerToList(const std::string &fileName) { - XML::Document *doc = new XML::Document(fileName); + XML::Document *doc = new XML::Document(fileName, true); XmlNodePtrConst node = doc->rootNode(); if (!node) { @@ -235,7 +235,7 @@ Map *MapReader::readMap(const std::string &restrict filename, BLOCK_START("MapReader::readMap str") logger->log("Attempting to read map %s", realFilename.c_str()); - XML::Document doc(realFilename); + XML::Document doc(realFilename, true); if (!doc.isLoaded()) { BLOCK_END("MapReader::readMap str") @@ -893,7 +893,7 @@ Tileset *MapReader::readTileset(XmlNodePtr node, std::string filename = XML::getProperty(node, "source", ""); filename = resolveRelativePath(path, filename); - doc = new XML::Document(filename); + doc = new XML::Document(filename, true); node = doc->rootNode(); if (!node) { diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index 3e99df4dd..4151b73fd 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -87,7 +87,7 @@ SpriteDef *SpriteDef::load(const std::string &animationFile, if (pos != std::string::npos) palettes = animationFile.substr(pos + 1); - XML::Document doc(animationFile.substr(0, pos)); + XML::Document doc(animationFile.substr(0, pos), true); XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "sprite")) @@ -428,7 +428,7 @@ void SpriteDef::includeSprite(const XmlNodePtr includeNode, const int variant) } mProcessedFiles.insert(filename); - XML::Document doc(filename); + XML::Document doc(filename, true); const XmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "sprite")) diff --git a/src/statuseffect.cpp b/src/statuseffect.cpp index 987529631..a11c815e3 100644 --- a/src/statuseffect.cpp +++ b/src/statuseffect.cpp @@ -150,7 +150,7 @@ void StatusEffect::load() void StatusEffect::loadXmlFile(const std::string &fileName) { - XML::Document doc(fileName); + XML::Document doc(fileName, true); const XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "status-effects")) diff --git a/src/units.cpp b/src/units.cpp index ad4dd1cbb..a182c67db 100644 --- a/src/units.cpp +++ b/src/units.cpp @@ -111,7 +111,7 @@ void Units::loadUnits() void Units::loadXmlFile(const std::string &fileName) { - XML::Document doc(fileName); + XML::Document doc(fileName, true); const XmlNodePtrConst root = doc.rootNode(); if (!root || !xmlNameEqual(root, "units")) diff --git a/src/utils/xml.h b/src/utils/xml.h index c8c15a719..dd06f8df1 100644 --- a/src/utils/xml.h +++ b/src/utils/xml.h @@ -66,7 +66,7 @@ namespace XML * resource manager. Logs errors. */ explicit Document(const std::string &filename, - const bool useResman = true); + const bool useResman); /** * Constructor that attempts to load an XML document from memory. diff --git a/src/utils/xmlutils.cpp b/src/utils/xmlutils.cpp index 64ae45209..2e4a7d736 100644 --- a/src/utils/xmlutils.cpp +++ b/src/utils/xmlutils.cpp @@ -34,7 +34,7 @@ void readXmlIntVector(const std::string &fileName, std::vector<int> &arr) { arr.clear(); - XML::Document doc(fileName); + XML::Document doc(fileName, true); const XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, rootName.c_str())) |