ManaPlus
Namespaces | Functions | Variables
badgesdb.cpp File Reference

(642df39)

#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 57 of file badgesdb.cpp.

58 {
59  loadXmlFile(paths.getStringValue("badgesFile"),
60  name, arr, SkipError_false);
61  loadXmlFile(paths.getStringValue("badgesPatchFile"),
62  name, arr, SkipError_true);
63 
64  StringVect listVect;
66  "badgesPatchDir"),
67  listVect,
68  ".xml");
69  FOR_EACH (StringVectCIter, itVect, listVect)
70  loadXmlFile(*itVect, name, arr, SkipError_true);
71 }

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
SkipError_true
const bool SkipError_true
Definition: skiperror.h:29
paths
Configuration paths
Definition: configuration.cpp:55
SkipError_false
const bool SkipError_false
Definition: skiperror.h:29
StringVect
std::vector< std::string > StringVect
Definition: stringvector.h:28
loadXmlFile
static void loadXmlFile(const std::string &file, const std::string &name, BadgesInfos &arr, const SkipError skipError)
Definition: badgesdb.cpp:42
Configuration::getStringValue
std::string getStringValue(const std::string &key) const
Definition: configuration.cpp:487
VirtFs::getFilesInDir
void getFilesInDir(const std::string &dir, StringVect &list, const std::string &ext)
Definition: tools.cpp:80
StringVectCIter
StringVect::const_iterator StringVectCIter
Definition: stringvector.h:30
readXmlStringMap
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:79
FOR_EACH
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24