1 // 2 // Script std::string 3 // 4 // This function registers the std::string type with AngelScript to be used as the default string type. 5 // 6 // The string type is registered as a value type, thus may have performance issues if a lot of 7 // string operations are performed in the script. However, for relatively few operations, this should 8 // not cause any problem for most applications. 9 // 10 11 #ifndef SCRIPTSTDSTRING_H 12 #define SCRIPTSTDSTRING_H 13 14 #ifndef ANGELSCRIPT_H 15 // Avoid having to inform include path if header is already include before 16 #include "angelscript.h" 17 #endif 18 19 #include <string> 20 21 //--------------------------- 22 // Compilation settings 23 // 24 25 // The use of the string pool can improve performance quite drastically 26 // for scripts that work with a lot of literal string constants. 27 // 28 // 1 = on 29 // 0 = off 30 31 #ifndef AS_USE_STRINGPOOL 32 #define AS_USE_STRINGPOOL 1 33 #endif 34 35 // Sometimes it may be desired to use the same method names as used by C++ STL. 36 // This may for example reduce time when converting code from script to C++ or 37 // back. 38 // 39 // 0 = off 40 // 1 = on 41 42 #ifndef AS_USE_STLNAMES 43 #define AS_USE_STLNAMES 0 44 #endif 45 46 BEGIN_AS_NAMESPACE 47 48 void RegisterStdString(asIScriptEngine *engine); 49 void RegisterStdStringUtils(asIScriptEngine *engine); 50 51 END_AS_NAMESPACE 52 53 #endif 54