#include <CCString.h>
Public Member Functions | |
CCString () | |
CCString (const char *str) | |
CCString (const std::string &str) | |
CCString (const CCString &str) | |
virtual | ~CCString () |
CCString & | operator= (const CCString &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... | |
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... | |
unsigned int | length () const |
get the length of string More... | |
int | compare (const char *) const |
compare to a c string More... | |
virtual CCObject * | copyWithZone (CCZone *pZone) |
virtual bool | isEqual (const CCObject *pObject) |
virtual void | acceptVisitor (CCDataVisitor &visitor) |
![]() | |
CCObject (void) | |
virtual | ~CCObject (void) |
void | release (void) |
void | retain (void) |
CCObject * | autorelease (void) |
CCObject * | copy (void) |
bool | isSingleReference (void) const |
unsigned int | retainCount (void) const |
virtual void | update (float dt) |
Static Public Member Functions | |
static CCString * | 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... | |
static CCString * | 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 CCString.cpp file. More... | |
static CCString static CCString * | createWithData (const unsigned char *pData, unsigned long nLen) |
create a string with binary data More... | |
static CCString * | createWithContentsOfFile (const char *pszFileName) |
create a string with a file, More... | |
Public Attributes | |
std::string | m_sString |
![]() | |
unsigned int | m_uID |
int | m_nLuaID |
Additional Inherited Members | |
![]() | |
unsigned int | m_uReference |
unsigned int | m_uAutoReleaseCount |
CCString | ( | ) |
CCString | ( | const char * | str) |
CCString | ( | const std::string & | str) |
|
virtual |
|
virtual |
Reimplemented from CCObject.
bool boolValue | ( | ) | const |
convert to bool value
int compare | ( | const char * | ) | const |
compare to a c 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 a file,
|
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 CCString.cpp file.
double doubleValue | ( | ) | const |
convert to double value
float floatValue | ( | ) | const |
convert to float value
const char* getCString | ( | ) | const |
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
unsigned int length | ( | ) | const |
get the length of string
unsigned int uintValue | ( | ) | const |
convert to unsigned int value
std::string m_sString |