RigsofRods
Soft-body Physics Simulation
Public Member Functions | Protected Attributes
RoR::LocalStorage Class Reference

A class that allows scripts to store data persistently. More...

#include <LocalStorage.h>

+ Inheritance diagram for RoR::LocalStorage:
+ Collaboration diagram for RoR::LocalStorage:

Public Member Functions

 LocalStorage (std::string filename, const std::string &section_name, const std::string &rg_name)
 
virtual ~LocalStorage () override
 
void copyFrom (LocalStoragePtr other)
 
void changeSection (const std::string &section)
 
std::string get (std::string key)
 
void set (std::string key, const std::string &value)
 
int getInt (std::string key)
 
void set (std::string key, const int value)
 
float getFloat (std::string key)
 
void set (std::string key, const float value)
 
bool getBool (std::string key)
 
void set (std::string key, const bool value)
 
Ogre::Vector3 getVector3 (std::string key)
 
void set (std::string key, const Ogre::Vector3 &value)
 
Ogre::Quaternion getQuaternion (std::string key)
 
void set (std::string key, const Ogre::Quaternion &value)
 
Ogre::Radian getRadian (std::string key)
 
void set (std::string key, const Ogre::Radian &value)
 
Ogre::Degree getDegree (std::string key)
 
void set (std::string key, const Ogre::Degree &value)
 
void saveDict ()
 
bool loadDict ()
 
void eraseKey (std::string key)
 
bool exists (std::string key)
 
void deleteAll ()
 
void parseKey (std::string &inout_key, std::string &out_section)
 
SettingsBySection getSettings ()
 
std::string getFilename ()
 
std::string getSection ()
 
- Public Member Functions inherited from ImprovedConfigFile
 ImprovedConfigFile ()
 
 ~ImprovedConfigFile ()
 
void loadImprovedCfg (std::string const &filename, std::string const &resource_group_name)
 
bool hasSetting (Ogre::String key, Ogre::String section="")
 
bool saveImprovedCfg (std::string const &filename, std::string const &resource_group_name)
 
void setSetting (Ogre::String key, Ogre::String value, Ogre::String section=Ogre::BLANKSTRING)
 
Ogre::Radian getSettingRadian (Ogre::String key, Ogre::String section=Ogre::BLANKSTRING)
 
void setSetting (Ogre::String key, Ogre::Radian value, Ogre::String section=Ogre::BLANKSTRING)
 
bool getSettingBool (Ogre::String key, Ogre::String section=Ogre::BLANKSTRING)
 
void setSetting (Ogre::String key, bool value, Ogre::String section=Ogre::BLANKSTRING)
 
Ogre::Real getSettingReal (Ogre::String key, Ogre::String section=Ogre::BLANKSTRING)
 
void setSetting (Ogre::String key, Ogre::Real value, Ogre::String section=Ogre::BLANKSTRING)
 
int getSettingInt (Ogre::String key, Ogre::String section=Ogre::BLANKSTRING)
 
void setSetting (Ogre::String key, int value, Ogre::String section=Ogre::BLANKSTRING)
 
unsigned int getSettingUnsignedInt (Ogre::String key, Ogre::String section=Ogre::BLANKSTRING)
 
void setSetting (Ogre::String key, unsigned int value, Ogre::String section=Ogre::BLANKSTRING)
 
long getSettingLong (Ogre::String key, Ogre::String section=Ogre::BLANKSTRING)
 
void setSetting (Ogre::String key, long value, Ogre::String section=Ogre::BLANKSTRING)
 
unsigned long getSettingUnsignedLong (Ogre::String key, Ogre::String section=Ogre::BLANKSTRING)
 
void setSetting (Ogre::String key, unsigned long value, Ogre::String section=Ogre::BLANKSTRING)
 
Ogre::Vector3 getSettingVector3 (Ogre::String key, Ogre::String section=Ogre::BLANKSTRING)
 
void setSetting (Ogre::String key, Ogre::Vector3 value, Ogre::String section=Ogre::BLANKSTRING)
 
Ogre::Matrix3 getSettingMatrix3 (Ogre::String key, Ogre::String section=Ogre::BLANKSTRING)
 
void setSetting (Ogre::String key, Ogre::Matrix3 value, Ogre::String section=Ogre::BLANKSTRING)
 
Ogre::Matrix4 getSettingMatrix4 (Ogre::String key, Ogre::String section=Ogre::BLANKSTRING)
 
void setSetting (Ogre::String key, Ogre::Matrix4 value, Ogre::String section=Ogre::BLANKSTRING)
 
Ogre::Quaternion getSettingQuaternion (Ogre::String key, Ogre::String section=Ogre::BLANKSTRING)
 
void setSetting (Ogre::String key, Ogre::Quaternion value, Ogre::String section=Ogre::BLANKSTRING)
 
Ogre::ColourValue getSettingColorValue (Ogre::String key, Ogre::String section=Ogre::BLANKSTRING)
 
void setSetting (Ogre::String key, Ogre::ColourValue value, Ogre::String section=Ogre::BLANKSTRING)
 
Ogre::StringVector getSettingStringVector (Ogre::String key, Ogre::String section=Ogre::BLANKSTRING)
 
void setSetting (Ogre::String key, Ogre::StringVector value, Ogre::String section=Ogre::BLANKSTRING)
 
- Public Member Functions inherited from RoR::ConfigFile
Ogre::ColourValue getColourValue (Ogre::String const &key, Ogre::ColourValue const &defaultValue=Ogre::ColourValue())
 
Ogre::ColourValue getColourValue (Ogre::String const &key, Ogre::String const &section, Ogre::ColourValue const &defaultValue=Ogre::ColourValue())
 
Ogre::Vector3 getVector3 (Ogre::String const &key, Ogre::String const &section, Ogre::Vector3 const &defaultValue=Ogre::Vector3::ZERO)
 
float getFloat (Ogre::String const &key, float defaultValue=0.f)
 
float getFloat (Ogre::String const &key, Ogre::String const &section, float defaultValue=0.f)
 
bool getBool (Ogre::String const &key, bool defaultValue=false)
 
bool getBool (Ogre::String const &key, Ogre::String const &section, bool defaultValue=false)
 
int getInt (Ogre::String const &key, int defaultValue=0)
 
int getInt (Ogre::String const &key, Ogre::String const &section, int defaultValue=0)
 
Ogre::String getString (Ogre::String const &key, Ogre::String const &section, Ogre::String const &defaultValue="")
 
void SetString (Ogre::String key, Ogre::String value, Ogre::String section=Ogre::BLANKSTRING)
 
bool HasSection (std::string const &name)
 
void setLoggingInfo (std::string const &filename, Console::MessageArea area)
 
- Public Member Functions inherited from RefCountingObject< LocalStorage >
 RefCountingObject ()
 
virtual ~RefCountingObject ()
 
void AddRef ()
 
void Release ()
 

Protected Attributes

std::string m_filename
 
std::string m_resource_group
 
bool saved
 Inverted 'dirty flag'. More...
 
std::string sectionName
 
- Protected Attributes inherited from ImprovedConfigFile
Ogre::String separators
 

Additional Inherited Members

- Static Public Member Functions inherited from RefCountingObject< LocalStorage >
static void RegisterRefCountingObject (AS_NAMESPACE_QUALIFIER asIScriptEngine *engine, const char *name)
 
- Data Fields inherited from RefCountingObject< LocalStorage >
int m_refcount
 
std::mutex m_refcount_mtx
 

Detailed Description

A class that allows scripts to store data persistently.

Definition at line 38 of file LocalStorage.h.

Constructor & Destructor Documentation

◆ LocalStorage()

LocalStorage::LocalStorage ( std::string  filename,
const std::string &  section_name,
const std::string &  rg_name = RGN_CACHE 
)

Definition at line 33 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ ~LocalStorage()

LocalStorage::~LocalStorage ( )
overridevirtual

Definition at line 52 of file LocalStorage.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ changeSection()

void LocalStorage::changeSection ( const std::string &  section)

Definition at line 74 of file LocalStorage.cpp.

◆ copyFrom()

void LocalStorage::copyFrom ( LocalStoragePtr  other)

Definition at line 58 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ deleteAll()

void LocalStorage::deleteAll ( )

Definition at line 246 of file LocalStorage.cpp.

◆ eraseKey()

void LocalStorage::eraseKey ( std::string  key)

Definition at line 237 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ exists()

bool LocalStorage::exists ( std::string  key)

Definition at line 267 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ get()

std::string LocalStorage::get ( std::string  key)

Definition at line 80 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ getBool()

bool LocalStorage::getBool ( std::string  key)

Definition at line 125 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ getDegree()

Ogre::Degree LocalStorage::getDegree ( std::string  key)

Definition at line 185 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ getFilename()

std::string RoR::LocalStorage::getFilename ( )
inline

Definition at line 88 of file LocalStorage.h.

◆ getFloat()

float LocalStorage::getFloat ( std::string  key)

Definition at line 110 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ getInt()

int LocalStorage::getInt ( std::string  key)

Definition at line 95 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ getQuaternion()

Ogre::Quaternion LocalStorage::getQuaternion ( std::string  key)

Definition at line 155 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ getRadian()

Ogre::Radian LocalStorage::getRadian ( std::string  key)

Definition at line 170 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ getSection()

std::string RoR::LocalStorage::getSection ( )
inline

Definition at line 89 of file LocalStorage.h.

◆ getSettings()

SettingsBySection RoR::LocalStorage::getSettings ( )
inline

Definition at line 87 of file LocalStorage.h.

◆ getVector3()

Ogre::Vector3 LocalStorage::getVector3 ( std::string  key)

Definition at line 140 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ loadDict()

bool LocalStorage::loadDict ( )

Definition at line 220 of file LocalStorage.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseKey()

void LocalStorage::parseKey ( std::string &  inout_key,
std::string &  out_section 
)

Definition at line 251 of file LocalStorage.cpp.

+ Here is the caller graph for this function:

◆ saveDict()

void LocalStorage::saveDict ( )

Definition at line 200 of file LocalStorage.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set() [1/8]

void LocalStorage::set ( std::string  key,
const bool  value 
)

Definition at line 132 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ set() [2/8]

void LocalStorage::set ( std::string  key,
const float  value 
)

Definition at line 117 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ set() [3/8]

void LocalStorage::set ( std::string  key,
const int  value 
)

Definition at line 102 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ set() [4/8]

void LocalStorage::set ( std::string  key,
const Ogre::Degree &  value 
)

Definition at line 192 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ set() [5/8]

void LocalStorage::set ( std::string  key,
const Ogre::Quaternion &  value 
)

Definition at line 162 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ set() [6/8]

void LocalStorage::set ( std::string  key,
const Ogre::Radian &  value 
)

Definition at line 177 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ set() [7/8]

void LocalStorage::set ( std::string  key,
const Ogre::Vector3 &  value 
)

Definition at line 147 of file LocalStorage.cpp.

+ Here is the call graph for this function:

◆ set() [8/8]

void LocalStorage::set ( std::string  key,
const std::string &  value 
)

Definition at line 87 of file LocalStorage.cpp.

+ Here is the call graph for this function:

Field Documentation

◆ m_filename

std::string RoR::LocalStorage::m_filename
protected

Definition at line 92 of file LocalStorage.h.

◆ m_resource_group

std::string RoR::LocalStorage::m_resource_group
protected

Definition at line 93 of file LocalStorage.h.

◆ saved

bool RoR::LocalStorage::saved
protected

Inverted 'dirty flag'.

Definition at line 94 of file LocalStorage.h.

◆ sectionName

std::string RoR::LocalStorage::sectionName
protected

Definition at line 95 of file LocalStorage.h.


The documentation for this class was generated from the following files: