OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
globals.hpp
Go to the documentation of this file.
1 #ifndef GAME_MWWORLD_GLOBALS_H
2 #define GAME_MWWORLD_GLOBALS_H
3 
4 #include <vector>
5 #include <string>
6 #include <map>
7 
8 #include <stdint.h>
9 
12 
13 namespace ESM
14 {
15  class ESMWriter;
16  class ESMReader;
17 }
18 
19 namespace Loading
20 {
21  class Listener;
22 }
23 
24 namespace MWWorld
25 {
26  class ESMStore;
27 
28  class Globals
29  {
30  private:
31 
32  typedef std::map<std::string, ESM::Global> Collection;
33 
34  Collection mVariables; // type, value
35 
36  Collection::const_iterator find (const std::string& name) const;
37 
38  Collection::iterator find (const std::string& name);
39 
40  public:
41 
42  const ESM::Variant& operator[] (const std::string& name) const;
43 
44  ESM::Variant& operator[] (const std::string& name);
45 
46  char getType (const std::string& name) const;
48 
49  void fill (const MWWorld::ESMStore& store);
51 
52  int countSavedGameRecords() const;
53 
54  void write (ESM::ESMWriter& writer, Loading::Listener& progress) const;
55 
56  bool readRecord (ESM::ESMReader& reader, uint32_t type);
60 
61  };
62 }
63 
64 #endif
void write(ESM::ESMWriter &writer, Loading::Listener &progress) const
Definition: globals.cpp:79
Definition: esmreader.hpp:21
Definition: globals.hpp:28
bool readRecord(ESM::ESMReader &reader, uint32_t type)
Definition: globals.cpp:89
Definition: loadinglistener.hpp:8
void fill(const MWWorld::ESMStore &store)
Replace variables with variables from store with default values.
Definition: globals.cpp:34
Definition: esmwriter.hpp:17
Definition: esmstore.hpp:17
Collection mVariables
Definition: globals.hpp:34
Collection::const_iterator find(const std::string &name) const
Definition: globals.cpp:14
Definition: variant.hpp:25
const ESM::Variant & operator[](const std::string &name) const
Definition: globals.cpp:47
int countSavedGameRecords() const
Definition: globals.cpp:74
std::map< std::string, ESM::Global > Collection
Definition: globals.hpp:32
char getType(const std::string &name) const
If there is no global variable with this name, ' ' is returned.
Definition: globals.cpp:57
const char * name
Definition: crashcatcher.cpp:59