2021-07-04 03:34:33 +03:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
#include "Library/Utils/Dictionary.hpp"
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
namespace SqMod {
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
SQMOD_DECL_TYPENAME(SqDictionaryTn, _SC("SqDictionary"))
|
|
|
|
|
|
|
|
// ================================================================================================
|
|
|
|
void Register_Dictionary(HSQUIRRELVM vm, Table & ns)
|
|
|
|
{
|
|
|
|
ns.Bind(_SC("Dictionary"),
|
|
|
|
Class< SqDictionary >(vm, SqDictionaryTn::Str)
|
|
|
|
// Constructors
|
|
|
|
.Ctor()
|
|
|
|
.Ctor< SQInteger >()
|
|
|
|
// Meta-methods
|
|
|
|
.SquirrelFunc(_SC("_typename"), &SqDictionaryTn::Fn)
|
|
|
|
// Properties
|
|
|
|
.Prop(_SC("Empty"), &SqDictionary::Empty)
|
|
|
|
.Prop(_SC("Size"), &SqDictionary::Size)
|
|
|
|
// Member Methods
|
|
|
|
.Func(_SC("Get"), &SqDictionary::Get)
|
|
|
|
.Func(_SC("Set"), &SqDictionary::Set)
|
2021-07-04 03:41:53 +03:00
|
|
|
.Func(_SC("GetOr"), &SqDictionary::GetOr)
|
2021-07-04 03:34:33 +03:00
|
|
|
.Func(_SC("Clear"), &SqDictionary::Clear)
|
|
|
|
.Func(_SC("Erase"), &SqDictionary::Erase)
|
2021-07-04 03:39:41 +03:00
|
|
|
.Func(_SC("Contains"), &SqDictionary::Contains)
|
2021-07-04 03:34:33 +03:00
|
|
|
.CbFunc(_SC("Each"), &SqDictionary::Each)
|
|
|
|
.CbFunc(_SC("EachWith"), &SqDictionary::EachWith)
|
|
|
|
.CbFunc(_SC("While"), &SqDictionary::While)
|
|
|
|
.CbFunc(_SC("WhileWith"), &SqDictionary::WhileWith)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // Namespace:: SqMod
|