|
@@ -59,25 +59,25 @@ static String StringJoined(CScriptArray* arr, const String& glue)
|
|
|
|
|
|
|
|
static void RegisterStringUtils(asIScriptEngine* engine)
|
|
static void RegisterStringUtils(asIScriptEngine* engine)
|
|
|
{
|
|
{
|
|
|
- engine->RegisterObjectMethod("String", "bool ToBool() const", AS_FUNCTIONPR_OBJLAST(ToBool, (const String&), bool), AS_CALL_CDECL_OBJLAST);
|
|
|
|
|
- engine->RegisterObjectMethod("String", "float ToFloat() const", AS_FUNCTIONPR_OBJLAST(ToFloat, (const String&), float), AS_CALL_CDECL_OBJLAST);
|
|
|
|
|
- engine->RegisterObjectMethod("String", "double ToDouble() const", AS_FUNCTIONPR_OBJLAST(ToDouble, (const String&), double), AS_CALL_CDECL_OBJLAST);
|
|
|
|
|
- engine->RegisterObjectMethod("String", "int ToInt(int base = 10) const", AS_FUNCTIONPR_OBJLAST(ToInt, (const String&, int), int), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
- engine->RegisterObjectMethod("String", "uint ToUInt(int base = 10) const", AS_FUNCTIONPR_OBJLAST(ToUInt, (const String&, int), unsigned), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
- engine->RegisterObjectMethod("String", "int64 ToInt64(int base = 10) const", AS_FUNCTIONPR_OBJLAST(ToInt64, (const String&, int), long long), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
- engine->RegisterObjectMethod("String", "uint64 ToUInt64(int base = 10) const", AS_FUNCTIONPR_OBJLAST(ToUInt64, (const String&, int), unsigned long long), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
- engine->RegisterObjectMethod("String", "Color ToColor() const", AS_FUNCTIONPR_OBJLAST(ToColor, (const String&), Color), AS_CALL_CDECL_OBJLAST);
|
|
|
|
|
- engine->RegisterObjectMethod("String", "IntRect ToIntRect() const", AS_FUNCTIONPR_OBJLAST(ToIntRect, (const String&), IntRect), AS_CALL_CDECL_OBJLAST);
|
|
|
|
|
- engine->RegisterObjectMethod("String", "IntVector2 ToIntVector2() const", AS_FUNCTIONPR_OBJLAST(ToIntVector2, (const String&), IntVector2), AS_CALL_CDECL_OBJLAST);
|
|
|
|
|
- engine->RegisterObjectMethod("String", "IntVector3 ToIntVector3() const", AS_FUNCTIONPR_OBJLAST(ToIntVector3, (const String&), IntVector3), AS_CALL_CDECL_OBJLAST);
|
|
|
|
|
- engine->RegisterObjectMethod("String", "Quaternion ToQuaternion() const", AS_FUNCTIONPR_OBJLAST(ToQuaternion, (const String&), Quaternion), AS_CALL_CDECL_OBJLAST);
|
|
|
|
|
- engine->RegisterObjectMethod("String", "Vector2 ToVector2() const", AS_FUNCTIONPR_OBJLAST(ToVector2, (const String&), Vector2), AS_CALL_CDECL_OBJLAST);
|
|
|
|
|
- engine->RegisterObjectMethod("String", "Vector3 ToVector3() const", AS_FUNCTIONPR_OBJLAST(ToVector3, (const String&), Vector3), AS_CALL_CDECL_OBJLAST);
|
|
|
|
|
- engine->RegisterObjectMethod("String", "Vector4 ToVector4(bool allowMissingCoords = false) const", AS_FUNCTIONPR_OBJLAST(ToVector4, (const String&, bool), Vector4), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
- engine->RegisterObjectMethod("String", "Variant ToVectorVariant() const", AS_FUNCTIONPR_OBJLAST(ToVectorVariant, (const String&), Variant), AS_CALL_CDECL_OBJLAST);
|
|
|
|
|
- engine->RegisterObjectMethod("String", "Matrix3 ToMatrix3() const", AS_FUNCTIONPR_OBJLAST(ToMatrix3, (const String&), Matrix3), AS_CALL_CDECL_OBJLAST);
|
|
|
|
|
- engine->RegisterObjectMethod("String", "Matrix3x4 ToMatrix3x4() const", AS_FUNCTIONPR_OBJLAST(ToMatrix3x4, (const String&), Matrix3x4), AS_CALL_CDECL_OBJLAST);
|
|
|
|
|
- engine->RegisterObjectMethod("String", "Matrix4 ToMatrix4() const", AS_FUNCTIONPR_OBJLAST(ToMatrix4, (const String&), Matrix4), AS_CALL_CDECL_OBJLAST);
|
|
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "bool ToBool() const", AS_FUNCTIONPR_OBJFIRST(ToBool, (const String&), bool), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "float ToFloat() const", AS_FUNCTIONPR_OBJFIRST(ToFloat, (const String&), float), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "double ToDouble() const", AS_FUNCTIONPR_OBJFIRST(ToDouble, (const String&), double), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "int ToInt(int base = 10) const", AS_FUNCTIONPR_OBJFIRST(ToInt, (const String&, int), int), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "uint ToUInt(int base = 10) const", AS_FUNCTIONPR_OBJFIRST(ToUInt, (const String&, int), unsigned), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "int64 ToInt64(int base = 10) const", AS_FUNCTIONPR_OBJFIRST(ToInt64, (const String&, int), long long), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "uint64 ToUInt64(int base = 10) const", AS_FUNCTIONPR_OBJFIRST(ToUInt64, (const String&, int), unsigned long long), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "Color ToColor() const", AS_FUNCTIONPR_OBJFIRST(ToColor, (const String&), Color), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "IntRect ToIntRect() const", AS_FUNCTIONPR_OBJFIRST(ToIntRect, (const String&), IntRect), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "IntVector2 ToIntVector2() const", AS_FUNCTIONPR_OBJFIRST(ToIntVector2, (const String&), IntVector2), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "IntVector3 ToIntVector3() const", AS_FUNCTIONPR_OBJFIRST(ToIntVector3, (const String&), IntVector3), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "Quaternion ToQuaternion() const", AS_FUNCTIONPR_OBJFIRST(ToQuaternion, (const String&), Quaternion), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "Vector2 ToVector2() const", AS_FUNCTIONPR_OBJFIRST(ToVector2, (const String&), Vector2), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "Vector3 ToVector3() const", AS_FUNCTIONPR_OBJFIRST(ToVector3, (const String&), Vector3), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "Vector4 ToVector4(bool allowMissingCoords = false) const", AS_FUNCTIONPR_OBJFIRST(ToVector4, (const String&, bool), Vector4), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "Variant ToVectorVariant() const", AS_FUNCTIONPR_OBJFIRST(ToVectorVariant, (const String&), Variant), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "Matrix3 ToMatrix3() const", AS_FUNCTIONPR_OBJFIRST(ToMatrix3, (const String&), Matrix3), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "Matrix3x4 ToMatrix3x4() const", AS_FUNCTIONPR_OBJFIRST(ToMatrix3x4, (const String&), Matrix3x4), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
+ engine->RegisterObjectMethod("String", "Matrix4 ToMatrix4() const", AS_FUNCTIONPR_OBJFIRST(ToMatrix4, (const String&), Matrix4), AS_CALL_CDECL_OBJFIRST);
|
|
|
|
|
|
|
|
//engine->RegisterGlobalFunction("String ToStringHex(int)", asFUNCTION(ToStringHex), asCALL_CDECL);
|
|
//engine->RegisterGlobalFunction("String ToStringHex(int)", asFUNCTION(ToStringHex), asCALL_CDECL);
|
|
|
engine->RegisterGlobalFunction("String Join(String[]&, const String&in glue)", AS_FUNCTION(StringJoined), AS_CALL_CDECL);
|
|
engine->RegisterGlobalFunction("String Join(String[]&, const String&in glue)", AS_FUNCTION(StringJoined), AS_CALL_CDECL);
|