ManaPlus
Namespaces | Functions | Variables
badgesdb.cpp File Reference

(986a3bf)

#include "resources/db/badgesdb.h"
#include "configuration.h"
#include "logger.h"
#include "fs/virtfs/tools.h"
#include "utils/foreach.h"
#include "utils/xmlutils.h"
#include "debug.h"

Go to the source code of this file.

Namespaces

 anonymous_namespace{badgesdb.cpp}
 

Functions

static void loadXmlFile (const std::string &file, const std::string &name, BadgesInfos &arr, const SkipError skipError)
 
static void loadDB (const std::string &name, BadgesInfos &arr)
 

Variables

BadgesInfos anonymous_namespace{badgesdb.cpp}::mGuilds
 
BadgesInfos anonymous_namespace{badgesdb.cpp}::mNames
 
BadgesInfos anonymous_namespace{badgesdb.cpp}::mParties
 
BadgesInfos anonymous_namespace{badgesdb.cpp}::mClans
 
bool anonymous_namespace{badgesdb.cpp}::mLoaded = false
 

Function Documentation

◆ loadDB()

static void loadDB ( const std::string &  name,
BadgesInfos arr 
)
static

Definition at line 58 of file badgesdb.cpp.

59 {
60  loadXmlFile(paths.getStringValue("badgesFile"),
61  name, arr, SkipError_false);
62  loadXmlFile(paths.getStringValue("badgesPatchFile"),
63  name, arr, SkipError_true);
64 
65  StringVect listVect;
67  "badgesPatchDir"),
68  listVect,
69  ".xml");
70  FOR_EACH (StringVectCIter, itVect, listVect)
71  loadXmlFile(*itVect, name, arr, SkipError_true);
72 }
static void loadXmlFile(const std::string &file, const std::string &name, BadgesInfos &arr, const SkipError skipError)
Definition: badgesdb.cpp:43
std::string getStringValue(const std::string &key) const
Configuration paths
#define FOR_EACH(type, iter, array)
Definition: foreach.h:25
void getFilesInDir(const std::string &dir, StringVect &list, const std::string &ext)
Definition: tools.cpp:81
const bool SkipError_false
Definition: skiperror.h:30
const bool SkipError_true
Definition: skiperror.h:30
StringVect::const_iterator StringVectCIter
Definition: stringvector.h:31
std::vector< std::string > StringVect
Definition: stringvector.h:29

References FOR_EACH, VirtFs::getFilesInDir(), Configuration::getStringValue(), loadXmlFile(), paths, SkipError_false, and SkipError_true.

Referenced by BadgesDB::load().

◆ loadXmlFile()

static void loadXmlFile ( const std::string &  file,
const std::string &  name,
BadgesInfos arr,
const SkipError  skipError 
)
static

Definition at line 43 of file badgesdb.cpp.

47 {
48  readXmlStringMap(file,
49  "badges",
50  name,
51  "badge",
52  "name",
53  "image",
54  arr,
55  skipError);
56 }
void readXmlStringMap(const std::string &fileName, const std::string &rootName, const std::string &sectionName, const std::string &itemName, const std::string &attributeKeyName, const std::string &attributeValueName, std::map< std::string, std::string > &arr, const SkipError skipError)
Definition: xmlutils.cpp:80

References readXmlStringMap().

Referenced by AvatarDB::load(), ClanDb::load(), CommandsDB::load(), DeadDB::load(), ElementalDb::load(), EmoteDB::load(), GroupDb::load(), HomunculusDB::load(), HorseDB::load(), ItemDB::load(), ItemFieldDb::load(), ItemOptionDb::load(), LanguageDb::load(), MercenaryDB::load(), ModDB::load(), MonsterDB::load(), NetworkDb::load(), NPCDB::load(), NpcDialogDB::load(), PETDB::load(), QuestDb::load(), SkillUnitDb::load(), SoundDB::load(), StatDb::load(), StatusEffectDB::load(), TextDb::load(), UnitsDb::load(), loadDB(), 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(), and ItemDB::loadXmlFile().