cocos2d-x  2.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CCString Class Reference

#include <CCString.h>

Inheritance diagram for CCString:
CCObject CCCopying

Public Member Functions

 CCString ()
 CCString ()
 CCString (const char *str)
 CCString (const std::string &str)
 CCString (const CCString &str)
virtual ~CCString ()
var ~CCString ()
CCStringoperator= (const CCString &other)
local operator= ( local other)
bool initWithFormat (const char *format,...) CC_FORMAT_PRINTF(2
 init a string with format, it's similar with the c function 'sprintf' More...
 
var initWithFormat ( var format)
 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...
 
var floatValue ()
 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...
 
var boolValue ()
 convert to bool value More...
 
local boolValue ()
 convert to bool value More...
 
const char * getCString () const
 get the C string More...
 
var getCString ()
 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...
 
var compare ()
 compare to a c string More...
 
local compare ()
 compare to a c string More...
 
virtual CCObjectcopyWithZone (CCZone *pZone)
local copyWithZone ( local pZone)
virtual bool isEqual (const CCObject *pObject)
var isEqual ( var pObject)
local isEqual ( local pObject)
virtual void acceptVisitor (CCDataVisitor &visitor)
var acceptVisitor ( var visitor)
- Public Member Functions inherited from CCObject
 CCObject (void)
virtual ~CCObject (void)
void release (void)
void retain (void)
CCObjectautorelease (void)
CCObjectcopy (void)
bool isSingleReference (void) const
unsigned int retainCount (void) const
virtual void update (float dt)

Static Public Member Functions

static CCStringcreate (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...
 
var create ( var 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 CCStringcreateWithFormat (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...
 
var createWithFormat ( var 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 kMaxStringLen macro in CCString.cpp file. More...
 
static CCString static CCStringcreateWithData (const unsigned char *pData, unsigned long nLen)
 create a string with binary data More...
 
var createWithData ( var pData, var nLen)
 create a string with binary data More...
 
local createWithData ( local pData, local nLen)
 create a string with binary data More...
 
static CCStringcreateWithContentsOfFile (const char *pszFileName)
 create a string with a file, More...
 
var createWithContentsOfFile ( var pszFileName)
 create a string with a file, More...
 
local createWithContentsOfFile ( local pszFileName)
 create a string with a file, More...
 

Public Attributes

std::string m_sString
- Public Attributes inherited from CCObject
unsigned int m_uID
int m_nLuaID

Additional Inherited Members

- Protected Attributes inherited from CCObject
unsigned int m_uReference
unsigned int m_uAutoReleaseCount

Constructor & Destructor Documentation

CCString ( )
var CCString ( )
CCString ( const char *  str)
var CCString ( var  str)
CCString ( const std::string &  str)
var CCString ( var  str)
CCString ( const CCString str)
var CCString ( var  str)
virtual ~CCString ( )
virtual
var ~CCString ( )
virtual

Member Function Documentation

virtual void acceptVisitor ( CCDataVisitor visitor)
virtual

Reimplemented from CCObject.

var acceptVisitor ( var  visitor)
virtual

Reimplemented from CCObject.

bool boolValue ( ) const

convert to bool value

var boolValue ( )

convert to bool value

local boolValue ( )

convert to bool value

int compare ( const char *  ) const

compare to a c string

var compare ( var  )

compare to a c string

local compare ( local  )

compare to a c string

virtual CCObject* copyWithZone ( CCZone pZone)
virtual

Reimplemented from CCCopying.

var copyWithZone ( var  pZone)
virtual

Reimplemented from CCCopying.

local copyWithZone ( local  pZone)
virtual

Reimplemented from CCCopying.

static CCString* create ( const std::string &  str)
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.

Returns
A CCString pointer which is an autorelease object pointer, it means that you needn't do a release operation unless you retain it.
var create ( var  str)
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.

Returns
A CCString pointer which is an autorelease object pointer, it means that you needn't do a release operation unless you retain it.
local create ( local  str)
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.

Returns
A CCString pointer which is an autorelease object pointer, it means that you needn't do a release operation unless you retain it.
static CCString*
createWithContentsOfFile
( const char *  pszFileName)
static

create a string with a file,

Returns
A CCString pointer which is an autorelease object pointer, it means that you needn't do a release operation unless you retain it.
var createWithContentsOfFile ( var  pszFileName)
static

create a string with a file,

Returns
A CCString pointer which is an autorelease object pointer, it means that you needn't do a release operation unless you retain it.
local createWithContentsOfFile ( local  pszFileName)
static

create a string with a file,

Returns
A CCString pointer which is an autorelease object pointer, it means that you needn't do a release operation unless you retain it.
static CCString static
CCString* createWithData
( const unsigned char *  pData,
unsigned long  nLen 
)
static

create a string with binary data

Returns
A CCString pointer which is an autorelease object pointer, it means that you needn't do a release operation unless you retain it.
var createWithData ( var  pData,
var  nLen 
)
static

create a string with binary data

Returns
A CCString pointer which is an autorelease object pointer, it means that you needn't do a release operation unless you retain it.
local createWithData ( local  pData,
local  nLen 
)
static

create a string with binary data

Returns
A CCString pointer which is an autorelease object pointer, it means that you needn't do a release operation unless you retain it.
static CCString* createWithFormat ( const char *  format,
  ... 
)
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.

Returns
A CCString pointer which is an autorelease object pointer, it means that you needn't do a release operation unless you retain it.
var createWithFormat ( var  format,
  ... 
)
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.

Returns
A CCString pointer which is an autorelease object pointer, it means that you needn't do a release operation unless you retain it.
double doubleValue ( ) const

convert to double value

var doubleValue ( )

convert to double value

local doubleValue ( )

convert to double value

float floatValue ( ) const

convert to float value

var floatValue ( )

convert to float value

local floatValue ( )

convert to float value

const char* getCString ( ) const

get the C string

var getCString ( )

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'

var initWithFormat ( var  format,
  ... 
)

init a string with format, it's similar with the c function 'sprintf'

bool int intValue ( ) const

convert to int value

var intValue ( )

convert to int value

local intValue ( )

convert to int value

virtual bool isEqual ( const CCObject pObject)
virtual

Reimplemented from CCObject.

var isEqual ( var  pObject)
virtual

Reimplemented from CCObject.

local isEqual ( local  pObject)
virtual

Reimplemented from CCObject.

unsigned int length ( ) const

get the length of string

var length ( )

get the length of string

local length ( )

get the length of string

CCString& operator= ( const CCString other)
CCString& operator= ( var  other)
CCString& operator= ( local  other)
unsigned int uintValue ( ) const

convert to unsigned int value

var uintValue ( )

convert to unsigned int value

local uintValue ( )

convert to unsigned int value

Member Data Documentation

std::string m_sString

The documentation for this class was generated from the following file: