Path: /sdk/add_on/scriptstring/
This add-on registers a string type that is in most situations compatible with the std::string, except that it uses reference counting. This means that if you have an application function that takes a std::string by reference, you can register it with AngelScript to take a script string by reference. This works because the asCScriptString wraps the std::string type, with the std::string type at the first byte of the asCScriptString object.
Register the type with RegisterScriptString(asIScriptEngine*)
. Register the utility functions with RegisterScriptStringUtils(asIScriptEngine*)
.
Utility functions:
- string@ substring(const string &in, int, int)
- int findFirst(const string &in, const string &in)
- int findFirst(const string &in, const string &in, int)
- int findLast(const string &in, const string &in)
- int findLast(const string &in, const string &in, int)
- int findFirstOf(const string &in, const string &in)
- int findFirstOf(const string &in, const string &in, int)
- int findFirstNotOf(const string &in, const string &in)
- int findFirstNotOf(const string &in, const string &in, int)
- int findLastOf(const string &in, const string &in)
- int findLastOf(const string &in, const string &in, int)
- int findLastNotOf(const string &in, const string &in)
- int findLastNotOf(const string &in, const string &in, int)
- string@[]@ split(const string &in, const string &in)
- string@ join(const string@[] &in, const string &in)
- Todo:
- Expand the documentation for script string