RigsofRods
Soft-body Physics Simulation
LocalStorageClass.h
Go to the documentation of this file.
1 
2 namespace Script2Game {
3 
20 {
21 public:
30  LocalStorage(string filename, const string&in sectionname = "common", const string&in resource_group_name = "Cache");
31 
40  string get(string key);
41 
45  string getString(string key);
46 
50  void set(string key, const string value);
51 
57  void setString(string key, const string value);
58 
59  float getFloat(string key);
60  void set(string key, float value);
61  void setFloat(string key, float value);
62 
63  vector3 getVector3(string key);
64  void set(string key, const vector3 value);
65  void setVector3(string key, const vector3 value);
66 
67  radian getRadian(string key);
68  void set(string key, const radian value);
69  void setRadian(string key, const radian value);
70 
71  degree getDegree(string key);
72  void set(string key, const degree value);
73  void setDegree(string key, const degree value);
74 
75  quaternion getQuaternion(string key);
76  void set(string key, const quaternion value);
77  void setQuaternion(string key, const quaternion value);
78 
79  bool getBool(string key);
80  void set(string key, const bool value);
81  void setBool(string key, const bool value);
82 
83  int getInt(string key);
84  int getInteger(string key);
85  void set(string key, int);
86  void setInt(string key, int);
87  void setInteger(string key, int);
88 
93  void save();
94 
98  bool reload();
99 
105  bool exists(string key) const;
106 
111  void delete(string key);
112 
117  void changeSection(const string section);
118 };
119 
122 
123 } //namespace Script2Game
Script2Game::LocalStorageClass::save
void save()
This saves the data to a file.
Script2Game::LocalStorageClass::getString
string getString(string key)
Script2Game::LocalStorageClass::setBool
void setBool(string key, const bool value)
Script2Game::LocalStorageClass::setVector3
void setVector3(string key, const vector3 value)
Script2Game::LocalStorageClass
Binding of RoR::LocalStorage; A class that allows your script to store data persistently.
Definition: LocalStorageClass.h:19
quaternion
quaternion()
Script2Game::LocalStorageClass::setFloat
void setFloat(string key, float value)
Script2Game
Pseudo-namespace; it doesn't exist in code or script runtime, only in this documentation.
Definition: BeamClass.h:2
Script2Game::LocalStorageClass::exists
bool exists(string key) const
Check if certain key exists.
Script2Game::LocalStorageClass::setRadian
void setRadian(string key, const radian value)
Script2Game::LocalStorageClass::LocalStorage
LocalStorage(string filename, const string &in sectionname="common", const string &in resource_group_name="Cache")
The constructor for the class.
Script2Game::LocalStorageClass::getVector3
vector3 getVector3(string key)
Script2Game::LocalStorageClass::getDegree
degree getDegree(string key)
Script2Game::LocalStorageClass::setQuaternion
void setQuaternion(string key, const quaternion value)
Script2Game::LocalStorageClass::setInt
void setInt(string key, int)
Script2Game::LocalStorageClass::changeSection
void changeSection(const string section)
Changes the default section.
Script2Game::LocalStorageClass::setInteger
void setInteger(string key, int)
Script2Game::LocalStorageClass::getRadian
radian getRadian(string key)
Script2Game::LocalStorageClass::get
string get(string key)
A getter for string data.
Script2Game::LocalStorageClass::getFloat
float getFloat(string key)
Script2Game::LocalStorageClass::getInteger
int getInteger(string key)
Script2Game::LocalStorageClass::setString
void setString(string key, const string value)
This sets a key.
Script2Game::LocalStorageClass::getQuaternion
quaternion getQuaternion(string key)
Script2Game::LocalStorageClass::getBool
bool getBool(string key)
Script2Game::LocalStorageClass::set
void set(string key, const string value)
Script2Game::LocalStorageClass::setDegree
void setDegree(string key, const degree value)
Script2Game::LocalStorageClass::reload
bool reload()
This reloads the data from the saved file, overwriting your changes.
Script2Game::LocalStorageClass::getInt
int getInt(string key)