mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-02-20 19:57:12 +01:00
Implement the pure typename meta-methods in AES type using the standard method.
This commit is contained in:
parent
f18d4c948a
commit
847222685b
@ -10,12 +10,7 @@
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger AES256::Typename(HSQUIRRELVM vm)
|
||||
{
|
||||
static const SQChar name[] = _SC("SqAES256");
|
||||
sq_pushstring(vm, name, sizeof(name));
|
||||
return 1;
|
||||
}
|
||||
SQMODE_DECL_TYPENAME(Typename, _SC("SqAES256"))
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
AES256::AES256()
|
||||
@ -138,13 +133,13 @@ String AES256::Decrypt(CSStr data)
|
||||
// ================================================================================================
|
||||
void Register_AES(HSQUIRRELVM vm)
|
||||
{
|
||||
RootTable(vm).Bind("SqAES256", Class< AES256 >(vm, "SqAES256")
|
||||
RootTable(vm).Bind(Typename::Str, Class< AES256 >(vm, Typename::Str)
|
||||
// Constructors
|
||||
.Ctor()
|
||||
.Ctor< CSStr >()
|
||||
// Meta-methods
|
||||
.Func(_SC("_cmp"), &AES256::Cmp)
|
||||
.SquirrelFunc(_SC("_typename"), &AES256::Typename)
|
||||
.SquirrelFunc(_SC("_typename"), &Typename::Fn)
|
||||
.Func(_SC("cmp"), &AES256::Cmp)
|
||||
.Func(_SC("_tostring"), &AES256::ToString)
|
||||
/* Properties */
|
||||
.Prop(_SC("Key"), &AES256::GetKey)
|
||||
|
@ -62,11 +62,6 @@ public:
|
||||
*/
|
||||
CSStr ToString() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Used by the script engine to retrieve the name from instances of this type.
|
||||
*/
|
||||
static SQInteger Typename(HSQUIRRELVM vm);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated key.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user