ManaPlus
mapdb.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2008 Aethyra Development Team
4  * Copyright (C) 2011-2019 The ManaPlus Developers
5  * Copyright (C) 2019-2021 Andrei Karas
6  *
7  * This file is part of The ManaPlus Client.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef RESOURCES_DB_MAPDB_H
24 #define RESOURCES_DB_MAPDB_H
25 
27 
28 #include "resources/mapinfo.h"
29 
30 #include <map>
31 
32 #include "localconsts.h"
33 
37 namespace MapDB
38 {
42  void load();
43 
44  void loadRemapXmlFile(const std::string &fileName,
45  const SkipError skipError);
46 
47  void loadInfo(const std::string &fileName,
48  const SkipError skipError);
49 
53  void unload();
54 
55  const std::string getMapName(const std::string &name) A_WARN_UNUSED;
56 
57  const MapInfo *getMapAtlas(const std::string &name) A_WARN_UNUSED;
58 
59  const MapInfo *getAtlas(const std::string &name) A_WARN_UNUSED;
60 
61  bool isEmptyTileset(const std::string &name);
62 
63  // Maps DB
64  typedef std::map<std::string, std::string> Maps;
65  typedef Maps::iterator MapIterator;
66  // map to infos map
67  typedef std::map<std::string, MapInfo> MapInfos;
68  typedef MapInfos::iterator MapInfoIter;
69  // atlas to files map
70  typedef std::map<std::string, StringVect> Atlases;
71  typedef Atlases::iterator AtlasIter;
72  typedef Atlases::const_iterator AtlasCIter;
73 } // namespace MapDB
74 
75 #endif // RESOURCES_DB_MAPDB_H
#define A_WARN_UNUSED
Definition: localconsts.h:161
Definition: mapdb.cpp:42
MapInfos::iterator MapInfoIter
Definition: mapdb.h:68
Atlases::iterator AtlasIter
Definition: mapdb.h:71
const MapInfo * getMapAtlas(const std::string &name)
Definition: mapdb.cpp:213
Atlases::const_iterator AtlasCIter
Definition: mapdb.h:72
const std::string getMapName(const std::string &name)
Definition: mapdb.cpp:204
std::map< std::string, StringVect > Atlases
Definition: mapdb.h:70
std::map< std::string, MapInfo > MapInfos
Definition: mapdb.h:67
void unload()
Definition: mapdb.cpp:196
Maps::iterator MapIterator
Definition: mapdb.h:65
std::map< std::string, std::string > Maps
Definition: mapdb.h:64
const MapInfo * getAtlas(const std::string &name)
Definition: mapdb.cpp:226
void loadRemapXmlFile(const std::string &fileName, const SkipError skipError)
Definition: mapdb.cpp:65
void loadInfo(const std::string &fileName, const SkipError skipError)
Definition: mapdb.cpp:162
bool isEmptyTileset(const std::string &name)
Definition: mapdb.cpp:238
void load()
Definition: mapdb.cpp:47
bool SkipError
Definition: skiperror.h:30
std::string fileName
Definition: testmain.cpp:39