clang-format on everything.

This commit is contained in:
Kevin Bentley
2024-04-16 12:56:40 -06:00
parent 142052a67d
commit c6640cc631
909 changed files with 652028 additions and 707349 deletions

View File

@@ -10,75 +10,72 @@
#ifdef _MSC_VER
// Turn off annoying warnings about truncated symbol names
#pragma warning (disable:4786)
#pragma warning(disable : 4786)
#endif
#include <map>
BEGIN_AS_NAMESPACE
class CScriptDictionary
{
class CScriptDictionary {
public:
// Memory management
CScriptDictionary(asIScriptEngine *engine);
void AddRef();
void Release();
// Memory management
CScriptDictionary(asIScriptEngine *engine);
void AddRef();
void Release();
// Sets/Gets a variable type value for a key
void Set(const std::string &key, void *value, int typeId);
bool Get(const std::string &key, void *value, int typeId) const;
// Sets/Gets a variable type value for a key
void Set(const std::string &key, void *value, int typeId);
bool Get(const std::string &key, void *value, int typeId) const;
// Sets/Gets an integer number value for a key
void Set(const std::string &key, asINT64 &value);
bool Get(const std::string &key, asINT64 &value) const;
// Sets/Gets an integer number value for a key
void Set(const std::string &key, asINT64 &value);
bool Get(const std::string &key, asINT64 &value) const;
// Sets/Gets a real number value for a key
void Set(const std::string &key, double &value);
bool Get(const std::string &key, double &value) const;
// Sets/Gets a real number value for a key
void Set(const std::string &key, double &value);
bool Get(const std::string &key, double &value) const;
// Returns true if the key is set
bool Exists(const std::string &key) const;
// Returns true if the key is set
bool Exists(const std::string &key) const;
// Deletes the key
void Delete(const std::string &key);
// Deletes the key
void Delete(const std::string &key);
// Deletes all keys
void DeleteAll();
// Deletes all keys
void DeleteAll();
// Garbage collections behaviours
int GetRefCount();
void SetGCFlag();
bool GetGCFlag();
void EnumReferences(asIScriptEngine *engine);
void ReleaseAllReferences(asIScriptEngine *engine);
// Garbage collections behaviours
int GetRefCount();
void SetGCFlag();
bool GetGCFlag();
void EnumReferences(asIScriptEngine *engine);
void ReleaseAllReferences(asIScriptEngine *engine);
protected:
// The structure for holding the values
struct valueStruct
{
union
{
asINT64 valueInt;
double valueFlt;
void *valueObj;
};
int typeId;
// The structure for holding the values
struct valueStruct {
union {
asINT64 valueInt;
double valueFlt;
void *valueObj;
};
// We don't want anyone to call the destructor directly, it should be called through the Release method
virtual ~CScriptDictionary();
int typeId;
};
// Don't allow assignment
CScriptDictionary &operator =(const CScriptDictionary &other);
// We don't want anyone to call the destructor directly, it should be called through the Release method
virtual ~CScriptDictionary();
// Helper methods
void FreeValue(valueStruct &value);
// Our properties
asIScriptEngine *engine;
int refCount;
std::map<std::string, valueStruct> dict;
// Don't allow assignment
CScriptDictionary &operator=(const CScriptDictionary &other);
// Helper methods
void FreeValue(valueStruct &value);
// Our properties
asIScriptEngine *engine;
int refCount;
std::map<std::string, valueStruct> dict;
};
// This function will determine the configuration of the engine