#include <CCString.h>
Public Member Functions | |
__String () | |
__String (const char *str) | |
__String (const std::string &str) | |
__String (const __String &str) | |
virtual | ~__String () |
__String & | operator= (const __String &other) |
local | operator= ( local other) |
bool | initWithFormat (const char *format,...) |
init a string with format, it's similar with the c function 'sprintf' More... | |
int | intValue () const |
convert to int value More... | |
unsigned int | uintValue () const |
convert to unsigned int value More... | |
local | uintValue () |
convert to unsigned int value More... | |
float | floatValue () const |
convert to float value More... | |
local | floatValue () |
convert to float value More... | |
double | doubleValue () const |
convert to double value More... | |
local | doubleValue () |
convert to double value More... | |
bool | boolValue () const |
convert to bool value More... | |
local | boolValue () |
convert to bool value More... | |
const char * | getCString () const |
get the C string More... | |
local | getCString () |
get the C string More... | |
int | length () const |
get the length of string More... | |
local | length () |
get the length of string More... | |
int | compare (const char *) const |
compare to a c string More... | |
local | compare () |
compare to a c string More... | |
void | append (const std::string &str) |
append additional characters at the end of its current value More... | |
void | appendWithFormat (const char *format,...) |
append(w/ format) additional characters at the end of its current value More... | |
__Array * | componentsSeparatedByString (const char *delimiter) |
split a string More... | |
virtual bool | isEqual (const Object *pObject) |
Returns a boolean value that indicates whether this object and a given object are equal. More... | |
var | isEqual ( var pObject) |
Returns a boolean value that indicates whether this object and a given object are equal. More... | |
local | isEqual ( local pObject) |
Returns a boolean value that indicates whether this object and a given object are equal. More... | |
virtual void | acceptVisitor (DataVisitor &visitor) |
virtual __String * | clone () const |
returns a copy of the object More... | |
![]() | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
void | release () |
Release the ownership immediately. More... | |
void | retain () |
Retains the ownership. More... | |
Object * | autorelease () |
Release the ownership sometime soon automatically. More... | |
bool | isSingleReference () const |
Returns a boolean value that indicates whether there is only one reference to the object. More... | |
unsigned int | retainCount () const |
Returns the object's current reference count. More... | |
unsigned int | getReferenceCount () const |
virtual void | update (float dt) |
![]() | |
virtual | ~Clonable () |
Object * | copy () const |
returns a copy of the object. More... | |
var | copy () |
returns a copy of the object. More... | |
local | copy () |
returns a copy of the object. More... | |
Static Public Member Functions | |
static __String * | create (const std::string &str) |
create a string with std string, you can also pass a c string pointer because the default constructor of std::string can access a c string pointer. More... | |
local | create ( local str) |
create a string with std string, you can also pass a c string pointer because the default constructor of std::string can access a c string pointer. More... | |
static __String * | createWithFormat (const char *format,...) |
create a string with format, it's similar with the c function 'sprintf', the default buffer size is (1024*100) bytes, if you want to change it, you should modify the kMax__StringLen macro in __String.cpp file. More... | |
static __String * | createWithData (const unsigned char *pData, int nLen) |
create a string with binary data More... | |
local | createWithData ( local pData, local nLen) |
create a string with binary data More... | |
static __String * | createWithContentsOfFile (const char *filename) |
create a string with a file, More... | |
local | createWithContentsOfFile ( local filename) |
create a string with a file, More... | |
Public Attributes | |
std::string | _string |
![]() | |
unsigned int | _ID |
object id, ScriptSupport need public _ID More... | |
int | _luaID |
Lua reference id. More... | |
Additional Inherited Members | |
![]() | |
unsigned int | _referenceCount |
count of references More... | |
__String | ( | ) |
__String | ( | const char * | str) |
__String | ( | const std::string & | str) |
|
virtual |
|
virtual |
Reimplemented from Object.
void append | ( | const std::string & | str) |
append additional characters at the end of its current value
void appendWithFormat | ( | const char * | format, |
... | |||
) |
append(w/ format) additional characters at the end of its current value
bool boolValue | ( | ) | const |
convert to bool value
local boolValue | ( | ) |
convert to bool value
int compare | ( | const char * | ) | const |
compare to a c string
local compare | ( | local | ) |
compare to a c string
__Array* componentsSeparatedByString |
( | const char * | delimiter) |
split a string
|
static |
create a string with std string, you can also pass a c string pointer because the default constructor of std::string can access a c string pointer.
|
static |
create a string with std string, you can also pass a c string pointer because the default constructor of std::string can access a c string pointer.
|
static |
create a string with a file,
|
static |
create a string with a file,
|
static |
create a string with binary data
|
static |
create a string with binary data
|
static |
create a string with format, it's similar with the c function 'sprintf', the default buffer size is (1024*100) bytes, if you want to change it, you should modify the kMax__StringLen macro in __String.cpp file.
|
static |
create a string with format, it's similar with the c function 'sprintf', the default buffer size is (1024*100) bytes, if you want to change it, you should modify the kMax__StringLen macro in __String.cpp file.
double doubleValue | ( | ) | const |
convert to double value
local doubleValue | ( | ) |
convert to double value
float floatValue | ( | ) | const |
convert to float value
local floatValue | ( | ) |
convert to float value
const char* getCString | ( | ) | const |
get the C string
local getCString | ( | ) |
get the C string
bool initWithFormat | ( | const char * | format, |
... | |||
) |
init a string with format, it's similar with the c function 'sprintf'
int intValue | ( | ) | const |
convert to int value
local intValue | ( | ) |
convert to int value
|
virtual |
Returns a boolean value that indicates whether this object and a given object are equal.
object | The object to be compared to this object. |
object
are equal, otherwise false. Reimplemented from Object.
|
virtual |
Returns a boolean value that indicates whether this object and a given object are equal.
object | The object to be compared to this object. |
object
are equal, otherwise false. Reimplemented from Object.
|
virtual |
Returns a boolean value that indicates whether this object and a given object are equal.
object | The object to be compared to this object. |
object
are equal, otherwise false. Reimplemented from Object.
int length | ( | ) | const |
get the length of string
local length | ( | ) |
get the length of string
__String& operator= | ( | var | other) |
__String& operator= | ( | local | other) |
unsigned int uintValue | ( | ) | const |
convert to unsigned int value
local uintValue | ( | ) |
convert to unsigned int value
std::string _string |