#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) |
| bool | initWithFormat (const char *format,...) CC_FORMAT_PRINTF(2 |
| init a string with format, it's similar with the c function 'sprintf' More... | |
| bool 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... | |
| double | doubleValue () const |
| convert to double value More... | |
| bool | boolValue () const |
| convert to bool value More... | |
| const char * | getCString () const |
| get the C string More... | |
| local | getCString () |
| get the C string More... | |
| unsigned 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... | |
| 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... | |
| virtual void | acceptVisitor (DataVisitor &visitor) |
| virtual String * | clone () const |
| returns a copy of the object More... | |
Public Member Functions inherited from Object | |
| 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... | |
| virtual void | update (float dt) |
Public Member Functions inherited from Clonable | |
| virtual | ~Clonable () |
| CC_DEPRECATED_ATTRIBUTE Object * | copy () const |
| 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,...) CC_FORMAT_PRINTF(1 |
| 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 kMaxStringLen macro in String.cpp file. More... | |
| static String static String * | createWithData (const unsigned char *pData, unsigned long nLen) |
| create a string with binary data More... | |
| static String * | createWithContentsOfFile (const char *filename) |
| create a string with a file, More... | |
Public Attributes | |
| std::string | _string |
Public Attributes inherited from Object | |
| unsigned int | _ID |
| object id, ScriptSupport need public _ID More... | |
| int | _luaID |
| Lua reference id. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Object | |
| unsigned int | _reference |
| count of references More... | |
| var | _reference |
| count of references More... | |
| local | _reference |
| count of references More... | |
| unsigned int | _autoReleaseCount |
| count of autorelease More... | |
| var | _autoReleaseCount |
| count of autorelease More... | |
| local | _autoReleaseCount |
| count of autorelease 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 kMaxStringLen 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 kMaxStringLen 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'
| bool 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.
| unsigned 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 |