22#include "../../autowrapper/aswrappedcall.h"
27#include <angelscript.h>
29using namespace AngelScript;
35 LocalStorage::RegisterRefCountingObjectGeneric(engine,
"LocalStorageClass");
39 r = engine->RegisterObjectBehaviour(
"LocalStorageClass", asBEHAVE_FACTORY,
"LocalStorageClass@+ f(string, const string&in = \"common\", const string&in = \"Cache\")",
WRAP_FN(
LocalStorageFactory), asCALL_GENERIC);
ROR_ASSERT(r >= 0);
41 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"void copyFrom(LocalStorageClassPtr@)",
WRAP_MFN(
LocalStorage, copyFrom), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
42 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"void changeSection(const string &in)",
WRAP_MFN(
LocalStorage, changeSection), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
44 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"string get(string)",
WRAP_MFN_PR(
LocalStorage, get, (std::string), std::string), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
45 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"string getString(string)",
WRAP_MFN_PR(
LocalStorage, get, (std::string), std::string), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
46 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"void set(string, const string &in)",
WRAP_MFN_PR(
LocalStorage, set, (std::string,
const std::string&),
void), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
47 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"void setString(string, const string &in)",
WRAP_MFN_PR(
LocalStorage, set, (std::string,
const std::string&),
void), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
49 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"float getFloat(string)",
WRAP_MFN_PR(
LocalStorage, getFloat, (std::string),
float), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
50 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"void set(string, float)",
WRAP_MFN_PR(
LocalStorage, set, (std::string,
const float),
void), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
51 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"void setFloat(string, float)",
WRAP_MFN_PR(
LocalStorage, set, (std::string,
const float),
void), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
53 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"vector3 getVector3(string)",
WRAP_MFN_PR(
LocalStorage, getVector3, (std::string), Ogre::Vector3), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
54 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"void set(string, const vector3 &in)",
WRAP_MFN_PR(
LocalStorage, set, (std::string,
const Ogre::Vector3&),
void), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
55 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"void setVector3(string, const vector3 &in)",
WRAP_MFN_PR(
LocalStorage, set, (std::string,
const Ogre::Vector3&),
void), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
57 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"radian getRadian(string)",
WRAP_MFN_PR(
LocalStorage, getRadian, (std::string), Ogre::Radian), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
58 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"void set(string, const radian &in)",
WRAP_MFN_PR(
LocalStorage, set, (std::string,
const Ogre::Radian&),
void), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
59 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"void setRadian(string, const radian &in)",
WRAP_MFN_PR(
LocalStorage, set, (std::string,
const Ogre::Radian&),
void), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
61 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"degree getDegree(string)",
WRAP_MFN_PR(
LocalStorage, getDegree, (std::string), Ogre::Degree), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
62 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"void set(string, const degree &in)",
WRAP_MFN_PR(
LocalStorage, set, (std::string,
const Ogre::Degree&),
void), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
63 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"void setDegree(string, const degree &in)",
WRAP_MFN_PR(
LocalStorage, set, (std::string,
const Ogre::Degree&),
void), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
65 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"quaternion getQuaternion(string)",
WRAP_MFN_PR(
LocalStorage, getQuaternion, (std::string), Ogre::Quaternion), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
66 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"void set(string, const quaternion &in)",
WRAP_MFN_PR(
LocalStorage, set, (std::string,
const Ogre::Quaternion&),
void), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
67 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"void setQuaternion(string, const quaternion &in)",
WRAP_MFN_PR(
LocalStorage, set, (std::string,
const Ogre::Quaternion&),
void), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
69 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"bool getBool(string)",
WRAP_MFN_PR(
LocalStorage, getBool, (std::string),
bool), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
73 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"int getInt(string)",
WRAP_MFN_PR(
LocalStorage, getInt, (std::string),
int), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
74 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"int getInteger(string)",
WRAP_MFN_PR(
LocalStorage, getInt, (std::string),
int), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
75 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"void set(string, int)",
WRAP_MFN_PR(
LocalStorage, set, (std::string,
const int),
void), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
76 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"void setInt(string, int)",
WRAP_MFN_PR(
LocalStorage, set, (std::string,
const int),
void), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
77 r = engine->RegisterObjectMethod(
"LocalStorageClass",
"void setInteger(string, int)",
WRAP_MFN_PR(
LocalStorage, set, (std::string,
const int),
void), asCALL_GENERIC);
ROR_ASSERT( r >= 0 );
#define ROR_ASSERT(_EXPR)
Helper/wrapper functions shared by native (LocalStorageAngelscript.cpp) and generic (LocalStorageAnge...
#define WRAP_MFN(ClassType, name)
#define WRAP_OBJ_FIRST(name)
#define WRAP_MFN_PR(ClassType, name, Parameters, ReturnType)
static void RegisterRefCountingObjectPtrGeneric(AS_NAMESPACE_QUALIFIER asIScriptEngine *engine, const char *handle_name, const char *obj_name)
Same as RegisterRefCountingObjectPtr() but uses the generic calling convention (for platforms with AS...
A class that allows scripts to store data persistently.
void RegisterLocalStorageGeneric(AngelScript::asIScriptEngine *engine)
static void LocalStorage_setBool(LocalStorage *self, std::string key, const bool &value)
static void LocalStorage_eraseKey(LocalStorage *self, const std::string &key)
static LocalStorage * LocalStorageFactory(std::string filename, const std::string §ion_name, const std::string &rg_name)
static bool LocalStorage_exists(LocalStorage *self, const std::string &key)