mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-08-03 06:31:47 +02:00
Updated the Squirrel and Sqrat libraries to the latest development versions.
This commit is contained in:
@@ -281,6 +281,44 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// Checks if the object has a slot with a specified key
|
||||
///
|
||||
/// \param key Name of the key
|
||||
///
|
||||
/// \return True if the Object has a value associated with key, otherwise false
|
||||
///
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
bool HasKey(const SQChar* key) const {
|
||||
sq_pushobject(vm, GetObject());
|
||||
sq_pushstring(vm, key, -1);
|
||||
if (SQ_FAILED(sq_get(vm, -2))) {
|
||||
sq_pop(vm, 1);
|
||||
return false;
|
||||
}
|
||||
sq_pop(vm, 2);
|
||||
return true;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// Checks if the object has a slot with a specified index
|
||||
///
|
||||
/// \param index Index to check
|
||||
///
|
||||
/// \return True if the Object has a value associated with index, otherwise false
|
||||
///
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
bool HasKey(SQInteger index) const {
|
||||
sq_pushobject(vm, GetObject());
|
||||
sq_pushinteger(vm, index);
|
||||
if (SQ_FAILED(sq_get(vm, -2))) {
|
||||
sq_pop(vm, 1);
|
||||
return false;
|
||||
}
|
||||
sq_pop(vm, 2);
|
||||
return true;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// Casts the object to a certain C++ type
|
||||
///
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#define SQSTD_STREAM_TYPE_TAG 0x80000000
|
||||
|
||||
struct SQStream {
|
||||
virtual ~SQStream() {}
|
||||
virtual SQInteger Read(void *buffer, SQInteger size) = 0;
|
||||
virtual SQInteger Write(void *buffer, SQInteger size) = 0;
|
||||
virtual SQInteger Flush() = 0;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2003-2014 Alberto Demichelis
|
||||
Copyright (c) 2003-2016 Alberto Demichelis
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -62,7 +62,7 @@ struct SQOuter;
|
||||
#include "sqconfig.h"
|
||||
|
||||
#define SQUIRREL_VERSION _SC("Squirrel 3.1 stable")
|
||||
#define SQUIRREL_COPYRIGHT _SC("Copyright (C) 2003-2015 Alberto Demichelis")
|
||||
#define SQUIRREL_COPYRIGHT _SC("Copyright (C) 2003-2016 Alberto Demichelis")
|
||||
#define SQUIRREL_AUTHOR _SC("Alberto Demichelis")
|
||||
#define SQUIRREL_VERSION_NUMBER 310
|
||||
|
||||
@@ -195,6 +195,7 @@ typedef struct tagSQFunctionInfo {
|
||||
}SQFunctionInfo;
|
||||
|
||||
#ifndef SQMOD_PLUGIN_API
|
||||
|
||||
/*vm*/
|
||||
SQUIRREL_API HSQUIRRELVM sq_open(SQInteger initialstacksize);
|
||||
SQUIRREL_API HSQUIRRELVM sq_newthread(HSQUIRRELVM friendvm, SQInteger initialstacksize);
|
||||
@@ -259,6 +260,7 @@ SQUIRREL_API SQRESULT sq_getbase(HSQUIRRELVM v,SQInteger idx);
|
||||
SQUIRREL_API SQBool sq_instanceof(HSQUIRRELVM v);
|
||||
SQUIRREL_API SQRESULT sq_tostring(HSQUIRRELVM v,SQInteger idx);
|
||||
SQUIRREL_API void sq_tobool(HSQUIRRELVM v, SQInteger idx, SQBool *b);
|
||||
SQUIRREL_API SQRESULT sq_getstringandsize(HSQUIRRELVM v,SQInteger idx,const SQChar **c,SQInteger *size);
|
||||
SQUIRREL_API SQRESULT sq_getstring(HSQUIRRELVM v,SQInteger idx,const SQChar **c);
|
||||
SQUIRREL_API SQRESULT sq_getinteger(HSQUIRRELVM v,SQInteger idx,SQInteger *i);
|
||||
SQUIRREL_API SQRESULT sq_getfloat(HSQUIRRELVM v,SQInteger idx,SQFloat *f);
|
||||
@@ -362,6 +364,7 @@ SQUIRREL_API void sq_free(void *p,SQUnsignedInteger size);
|
||||
SQUIRREL_API SQRESULT sq_stackinfos(HSQUIRRELVM v,SQInteger level,SQStackInfos *si);
|
||||
SQUIRREL_API void sq_setdebughook(HSQUIRRELVM v);
|
||||
SQUIRREL_API void sq_setnativedebughook(HSQUIRRELVM v,SQDEBUGHOOK hook);
|
||||
|
||||
#endif // SQMOD_PLUGIN_API
|
||||
|
||||
/*UTILITY MACRO*/
|
||||
|
Reference in New Issue
Block a user