summaryrefslogtreecommitdiff
path: root/src/resources/db
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-07 20:38:10 +0300
committerAndrei Karas <akaras@inbox.ru>2017-03-24 00:08:35 +0300
commitd1590377de1141144d59ca1160de2822177f6f2a (patch)
treea368b251dedc7164cadbfe459de4cf5c983acf98 /src/resources/db
parent65422e722cfe0616c65498c71aa0651857dcc49a (diff)
downloadmanaplus-d1590377de1141144d59ca1160de2822177f6f2a.tar.gz
manaplus-d1590377de1141144d59ca1160de2822177f6f2a.tar.bz2
manaplus-d1590377de1141144d59ca1160de2822177f6f2a.tar.xz
manaplus-d1590377de1141144d59ca1160de2822177f6f2a.zip
Add support for tinyxml2 for reading / writing xml files.
Diffstat (limited to 'src/resources/db')
-rw-r--r--src/resources/db/avatardb.cpp2
-rw-r--r--src/resources/db/chardb.cpp4
-rw-r--r--src/resources/db/chardb.h2
-rw-r--r--src/resources/db/colordb.cpp4
-rw-r--r--src/resources/db/commandsdb.cpp2
-rw-r--r--src/resources/db/deaddb.cpp2
-rw-r--r--src/resources/db/elementaldb.cpp2
-rw-r--r--src/resources/db/homunculusdb.cpp2
-rw-r--r--src/resources/db/itemdb.cpp24
-rw-r--r--src/resources/db/itemfielddb.cpp4
-rw-r--r--src/resources/db/mapdb.cpp4
-rw-r--r--src/resources/db/mercenarydb.cpp2
-rw-r--r--src/resources/db/moddb.cpp2
-rw-r--r--src/resources/db/monsterdb.cpp2
-rw-r--r--src/resources/db/npcdb.cpp2
-rw-r--r--src/resources/db/npcdialogdb.cpp6
-rw-r--r--src/resources/db/petdb.cpp2
-rw-r--r--src/resources/db/questdb.cpp6
-rw-r--r--src/resources/db/skillunitdb.cpp2
-rw-r--r--src/resources/db/sounddb.cpp2
-rw-r--r--src/resources/db/statdb.cpp6
-rw-r--r--src/resources/db/statuseffectdb.cpp2
-rw-r--r--src/resources/db/unitsdb.cpp2
23 files changed, 44 insertions, 44 deletions
diff --git a/src/resources/db/avatardb.cpp b/src/resources/db/avatardb.cpp
index 8af32cd6c..eddf08b29 100644
--- a/src/resources/db/avatardb.cpp
+++ b/src/resources/db/avatardb.cpp
@@ -57,7 +57,7 @@ void AvatarDB::loadXmlFile(const std::string &fileName,
XML::Document doc(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "avatars"))
{
diff --git a/src/resources/db/chardb.cpp b/src/resources/db/chardb.cpp
index eb96538c5..b0984a56f 100644
--- a/src/resources/db/chardb.cpp
+++ b/src/resources/db/chardb.cpp
@@ -52,7 +52,7 @@ void CharDB::load()
paths.getStringValue("charCreationFile"),
UseVirtFs_true,
SkipError_false);
- const XmlNodePtrConst root = doc->rootNode();
+ XmlNodeConstPtrConst root = doc->rootNode();
if (!root || !xmlNameEqual(root, "chars"))
{
@@ -109,7 +109,7 @@ void CharDB::load()
mLoaded = true;
}
-void CharDB::loadMinMax(const XmlNodePtr node,
+void CharDB::loadMinMax(XmlNodeConstPtr node,
unsigned *restrict const min,
unsigned *restrict const max)
{
diff --git a/src/resources/db/chardb.h b/src/resources/db/chardb.h
index 128777827..9715497f1 100644
--- a/src/resources/db/chardb.h
+++ b/src/resources/db/chardb.h
@@ -43,7 +43,7 @@ namespace CharDB
*/
void unload();
- void loadMinMax(const XmlNodePtr node,
+ void loadMinMax(XmlNodeConstPtr node,
unsigned *restrict const min,
unsigned *restrict const max);
diff --git a/src/resources/db/colordb.cpp b/src/resources/db/colordb.cpp
index 9261e8a76..cf377eca1 100644
--- a/src/resources/db/colordb.cpp
+++ b/src/resources/db/colordb.cpp
@@ -81,7 +81,7 @@ void ColorDB::loadHair(const std::string &fileName,
XML::Document *doc = new XML::Document(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst root = doc->rootNode();
+ XmlNodeConstPtrConst root = doc->rootNode();
if (!root || !xmlNameEqual(root, "colors"))
{
@@ -127,7 +127,7 @@ void ColorDB::loadColorLists(const std::string &fileName,
XML::Document *doc = new XML::Document(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst root = doc->rootNode();
+ XmlNodeConstPtrConst root = doc->rootNode();
if (!root)
{
delete doc;
diff --git a/src/resources/db/commandsdb.cpp b/src/resources/db/commandsdb.cpp
index 2338287c2..115046b1d 100644
--- a/src/resources/db/commandsdb.cpp
+++ b/src/resources/db/commandsdb.cpp
@@ -62,7 +62,7 @@ void CommandsDB::loadXmlFile(const std::string &fileName,
const SkipError skipError)
{
XML::Document doc(fileName, UseVirtFs_true, skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "commands"))
{
diff --git a/src/resources/db/deaddb.cpp b/src/resources/db/deaddb.cpp
index eddc4ff42..53a0f6e0f 100644
--- a/src/resources/db/deaddb.cpp
+++ b/src/resources/db/deaddb.cpp
@@ -52,7 +52,7 @@ void DeadDB::loadXmlFile(const std::string &fileName,
XML::Document *doc = new XML::Document(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst root = doc->rootNode();
+ XmlNodeConstPtrConst root = doc->rootNode();
if (!root || !xmlNameEqual(root, "messages"))
{
diff --git a/src/resources/db/elementaldb.cpp b/src/resources/db/elementaldb.cpp
index 21788b08e..2a626a10e 100644
--- a/src/resources/db/elementaldb.cpp
+++ b/src/resources/db/elementaldb.cpp
@@ -55,7 +55,7 @@ void ElementalDb::loadXmlFile(const std::string &fileName,
const SkipError skipError)
{
XML::Document doc(fileName, UseVirtFs_true, skipError);
- const XmlNodePtr rootNode = doc.rootNode();
+ XmlNodeConstPtr rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "elementals"))
{
diff --git a/src/resources/db/homunculusdb.cpp b/src/resources/db/homunculusdb.cpp
index 77c1b4323..cf627dc01 100644
--- a/src/resources/db/homunculusdb.cpp
+++ b/src/resources/db/homunculusdb.cpp
@@ -56,7 +56,7 @@ void HomunculusDB::loadXmlFile(const std::string &fileName,
const SkipError skipError)
{
XML::Document doc(fileName, UseVirtFs_true, skipError);
- const XmlNodePtr rootNode = doc.rootNode();
+ XmlNodeConstPtr rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "homunculuses"))
{
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp
index e347528eb..e6affd378 100644
--- a/src/resources/db/itemdb.cpp
+++ b/src/resources/db/itemdb.cpp
@@ -64,15 +64,15 @@ namespace
// Forward declarations
static void loadSpriteRef(ItemInfo *const itemInfo,
- const XmlNodePtr node) A_NONNULL(1);
+ XmlNodeConstPtr node) A_NONNULL(1);
static void loadSoundRef(ItemInfo *const itemInfo,
- const XmlNodePtr node) A_NONNULL(1);
+ XmlNodeConstPtr node) A_NONNULL(1);
static void loadFloorSprite(SpriteDisplay &display,
- const XmlNodePtrConst node);
+ XmlNodeConstPtrConst node);
static void loadReplaceSprite(ItemInfo *const itemInfo,
- const XmlNodePtr replaceNode) A_NONNULL(1);
+ XmlNodeConstPtr replaceNode) A_NONNULL(1);
static void loadOrderSprite(ItemInfo *const itemInfo,
- const XmlNodePtr node,
+ XmlNodeConstPtr node,
const bool drawAfter) A_NONNULL(1);
static int parseSpriteName(const std::string &name);
static int parseDirectionName(const std::string &name);
@@ -125,7 +125,7 @@ static std::string useButton2FromItemType(const ItemDbTypeT &type)
}
static void readFields(std::string &effect,
- const XmlNodePtr node,
+ XmlNodeConstPtr node,
const ItemFieldDb::FieldInfos &fields)
{
FOR_EACH (ItemFieldDb::FieldInfos::const_iterator, it, fields)
@@ -243,7 +243,7 @@ void ItemDB::loadXmlFile(const std::string &fileName,
XML::Document doc(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "items"))
{
@@ -829,7 +829,7 @@ static int parseDirectionName(const std::string &name)
return id;
}
-static void loadSpriteRef(ItemInfo *const itemInfo, const XmlNodePtr node)
+static void loadSpriteRef(ItemInfo *const itemInfo, XmlNodeConstPtr node)
{
const std::string gender = XML::getProperty(node, "gender", "unisex");
if (!node || !XmlHaveChildContent(node))
@@ -846,7 +846,7 @@ static void loadSpriteRef(ItemInfo *const itemInfo, const XmlNodePtr node)
itemInfo->setSprite(filename, Gender::OTHER, race);
}
-static void loadSoundRef(ItemInfo *const itemInfo, const XmlNodePtr node)
+static void loadSoundRef(ItemInfo *const itemInfo, XmlNodeConstPtr node)
{
if (!node || !XmlHaveChildContent(node))
return;
@@ -868,7 +868,7 @@ static void loadSoundRef(ItemInfo *const itemInfo, const XmlNodePtr node)
}
static void loadFloorSprite(SpriteDisplay &display,
- const XmlNodePtrConst floorNode)
+ XmlNodeConstPtrConst floorNode)
{
if (!floorNode)
return;
@@ -892,7 +892,7 @@ static void loadFloorSprite(SpriteDisplay &display,
}
static void loadReplaceSprite(ItemInfo *const itemInfo,
- const XmlNodePtr replaceNode)
+ XmlNodeConstPtr replaceNode)
{
if (!replaceNode)
return;
@@ -1025,7 +1025,7 @@ static void loadReplaceSprite(ItemInfo *const itemInfo,
}
static void loadOrderSprite(ItemInfo *const itemInfo,
- const XmlNodePtr node,
+ XmlNodeConstPtr node,
const bool drawAfter)
{
const int sprite = parseSpriteName(XML::getProperty(node, "name", ""));
diff --git a/src/resources/db/itemfielddb.cpp b/src/resources/db/itemfielddb.cpp
index 6ba76db2c..65020e824 100644
--- a/src/resources/db/itemfielddb.cpp
+++ b/src/resources/db/itemfielddb.cpp
@@ -51,7 +51,7 @@ void ItemFieldDb::load()
mLoaded = true;
}
-static void loadFields(const XmlNodePtr groupNode,
+static void loadFields(XmlNodeConstPtr groupNode,
ItemFieldDb::FieldInfos &fields1,
ItemFieldDb::FieldInfos &fields2)
{
@@ -105,7 +105,7 @@ void ItemFieldDb::loadXmlFile(const std::string &fileName,
XML::Document doc(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "itemfields"))
{
diff --git a/src/resources/db/mapdb.cpp b/src/resources/db/mapdb.cpp
index b9c6818b3..14c10b3b8 100644
--- a/src/resources/db/mapdb.cpp
+++ b/src/resources/db/mapdb.cpp
@@ -66,7 +66,7 @@ void MapDB::loadRemapXmlFile(const std::string &fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst root = doc->rootNode();
+ XmlNodeConstPtrConst root = doc->rootNode();
if (!root)
{
delete doc;
@@ -153,7 +153,7 @@ void MapDB::loadInfo(const std::string &fileName,
XML::Document *doc = new XML::Document(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst root = doc->rootNode();
+ XmlNodeConstPtrConst root = doc->rootNode();
if (!root)
{
delete doc;
diff --git a/src/resources/db/mercenarydb.cpp b/src/resources/db/mercenarydb.cpp
index 0e2fdcae0..bc1b20840 100644
--- a/src/resources/db/mercenarydb.cpp
+++ b/src/resources/db/mercenarydb.cpp
@@ -58,7 +58,7 @@ void MercenaryDB::loadXmlFile(const std::string &fileName,
XML::Document doc(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtr rootNode = doc.rootNode();
+ XmlNodeConstPtr rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "mercenaries"))
{
diff --git a/src/resources/db/moddb.cpp b/src/resources/db/moddb.cpp
index 4e67cb612..7a23e255f 100644
--- a/src/resources/db/moddb.cpp
+++ b/src/resources/db/moddb.cpp
@@ -52,7 +52,7 @@ void ModDB::loadXmlFile(const std::string &fileName,
const SkipError skipError)
{
XML::Document doc(fileName, UseVirtFs_true, skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "mods"))
{
diff --git a/src/resources/db/monsterdb.cpp b/src/resources/db/monsterdb.cpp
index 2c87f19f8..1ed0caa27 100644
--- a/src/resources/db/monsterdb.cpp
+++ b/src/resources/db/monsterdb.cpp
@@ -60,7 +60,7 @@ void MonsterDB::loadXmlFile(const std::string &fileName,
const SkipError skipError)
{
XML::Document doc(fileName, UseVirtFs_true, skipError);
- const XmlNodePtr rootNode = doc.rootNode();
+ XmlNodeConstPtr rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "monsters"))
{
diff --git a/src/resources/db/npcdb.cpp b/src/resources/db/npcdb.cpp
index 9c77950b7..9be217819 100644
--- a/src/resources/db/npcdb.cpp
+++ b/src/resources/db/npcdb.cpp
@@ -61,7 +61,7 @@ void NPCDB::loadXmlFile(const std::string &fileName,
const SkipError skipError)
{
XML::Document doc(fileName, UseVirtFs_true, skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "npcs"))
{
diff --git a/src/resources/db/npcdialogdb.cpp b/src/resources/db/npcdialogdb.cpp
index 6ab48e4bd..76eaea7c5 100644
--- a/src/resources/db/npcdialogdb.cpp
+++ b/src/resources/db/npcdialogdb.cpp
@@ -50,7 +50,7 @@ void NpcDialogDB::load()
}
static void loadNpcDialogMenu(NpcDialogInfo *const dialog,
- const XmlNodePtrConst node)
+ XmlNodeConstPtrConst node)
{
for_each_xml_child_node(childNode, node)
{
@@ -132,7 +132,7 @@ static void loadNpcDialogInventory(NpcDialogInfo *const dialog,
}
static void loadNpcDialog(NpcDialogInfo *const dialog,
- const XmlNodePtrConst node)
+ XmlNodeConstPtrConst node)
{
for_each_xml_child_node(childNode, node)
{
@@ -154,7 +154,7 @@ void NpcDialogDB::loadXmlFile(const std::string &fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst root = doc->rootNode();
+ XmlNodeConstPtrConst root = doc->rootNode();
if (!root)
{
delete doc;
diff --git a/src/resources/db/petdb.cpp b/src/resources/db/petdb.cpp
index d3d166675..5dca543a0 100644
--- a/src/resources/db/petdb.cpp
+++ b/src/resources/db/petdb.cpp
@@ -59,7 +59,7 @@ void PETDB::loadXmlFile(const std::string &fileName,
XML::Document doc(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "pets"))
{
diff --git a/src/resources/db/questdb.cpp b/src/resources/db/questdb.cpp
index 91dd44ac4..41b3b0062 100644
--- a/src/resources/db/questdb.cpp
+++ b/src/resources/db/questdb.cpp
@@ -52,7 +52,7 @@ void QuestDb::load()
}
static void loadQuest(const int var,
- const XmlNodePtr node)
+ XmlNodeConstPtr node)
{
if (!node)
return;
@@ -155,7 +155,7 @@ static void loadQuest(const int var,
}
static void loadEffect(const int var,
- const XmlNodePtr node)
+ XmlNodeConstPtr node)
{
QuestEffect *const effect = new QuestEffect;
effect->map = XML::getProperty(node, "map", "");
@@ -180,7 +180,7 @@ void QuestDb::loadXmlFile(const std::string &fileName,
XML::Document doc(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst root = doc.rootNode();
+ XmlNodeConstPtrConst root = doc.rootNode();
if (!root)
return;
diff --git a/src/resources/db/skillunitdb.cpp b/src/resources/db/skillunitdb.cpp
index 8beae1ac2..cec48a4a1 100644
--- a/src/resources/db/skillunitdb.cpp
+++ b/src/resources/db/skillunitdb.cpp
@@ -57,7 +57,7 @@ void SkillUnitDb::loadXmlFile(const std::string &fileName,
const SkipError skipError)
{
XML::Document doc(fileName, UseVirtFs_true, skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "skillunits"))
{
diff --git a/src/resources/db/sounddb.cpp b/src/resources/db/sounddb.cpp
index a62045505..d58a585ee 100644
--- a/src/resources/db/sounddb.cpp
+++ b/src/resources/db/sounddb.cpp
@@ -49,7 +49,7 @@ void SoundDB::loadXmlFile(const std::string &fileName,
XML::Document *doc = new XML::Document(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst root = doc->rootNode();
+ XmlNodeConstPtrConst root = doc->rootNode();
if (!root || !xmlNameEqual(root, "sounds"))
{
diff --git a/src/resources/db/statdb.cpp b/src/resources/db/statdb.cpp
index e2d4292a1..12126f36a 100644
--- a/src/resources/db/statdb.cpp
+++ b/src/resources/db/statdb.cpp
@@ -96,7 +96,7 @@ void StatDb::load()
mLoaded = true;
}
-static void loadBasicStats(const XmlNodePtr rootNode)
+static void loadBasicStats(XmlNodeConstPtr rootNode)
{
const int maxAttr = static_cast<int>(Attributes::MAX_ATTRIBUTE);
for_each_xml_child_node(node, rootNode)
@@ -131,7 +131,7 @@ static void loadBasicStats(const XmlNodePtr rootNode)
}
}
-static void loadStats(const XmlNodePtr rootNode,
+static void loadStats(XmlNodeConstPtr rootNode,
const std::string &page)
{
const int maxAttr = static_cast<int>(Attributes::MAX_ATTRIBUTE);
@@ -173,7 +173,7 @@ void StatDb::loadXmlFile(const std::string &fileName,
XML::Document doc(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "stats"))
{
diff --git a/src/resources/db/statuseffectdb.cpp b/src/resources/db/statuseffectdb.cpp
index fea06230e..58c5cf30d 100644
--- a/src/resources/db/statuseffectdb.cpp
+++ b/src/resources/db/statuseffectdb.cpp
@@ -88,7 +88,7 @@ void StatusEffectDB::loadXmlFile(const std::string &fileName,
const SkipError skipError)
{
XML::Document doc(fileName, UseVirtFs_true, skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "status-effects"))
{
diff --git a/src/resources/db/unitsdb.cpp b/src/resources/db/unitsdb.cpp
index 0c06f6a4c..0437c81e4 100644
--- a/src/resources/db/unitsdb.cpp
+++ b/src/resources/db/unitsdb.cpp
@@ -191,7 +191,7 @@ void UnitsDb::loadXmlFile(const std::string &fileName,
const SkipError skipError)
{
XML::Document doc(fileName, UseVirtFs_true, skipError);
- const XmlNodePtrConst root = doc.rootNode();
+ XmlNodeConstPtrConst root = doc.rootNode();
if (!root || !xmlNameEqual(root, "units"))
{