| cocos2d-x 3.0 |
)- 类列表 - 类索引 - 类继承关系 - 类成员
全部) 类) 命名空间) 文件) 函数) 变量) 类型定义) 枚举) 枚举值) 属性) 友元) 宏定义) 组) 页)
Public 成员函数 | 静态 Public 成员函数 | Public 属性 | 所有成员列表
String类 参考 [Data Structures](../../df/db3/groupdata__structures.html)
#include
类 __String 继承关系图:
| ## Public 成员函数 | |
| __String () | |
| NA NA 更多… | |
| __String (const char str) | |
| NA NA 更多… | |
| __String (const std::string &str) | |
| NA NA 更多… | |
| __String (const __String &str) | |
| NA NA 更多… | |
| virtual | ~__String () |
| NA NA 更多… | |
| __String & | operator= (const __String &other) |
| bool | initWithFormat (const char format,…) CC_FORMAT_PRINTF(2 |
| 初始化字符串格式, 和C语言的'sprintf' 函数类似 NA NA 更多… | |
| bool int | intValue () const |
| 转换为int类型 的值 NA 更多… | |
| unsigned int | uintValue () const |
| 转化为unsigned int 的值 NA 更多… | |
| float | floatValue () const |
| 转化为float value NA 更多… | |
| double | doubleValue () const |
| 转化为 double value NA 更多… | |
| bool | boolValue () const |
| 转化为 bool value NA 更多… | |
| const char | getCString () const |
| 获取C string NA 更多… | |
| int | length () const |
| 获取 string长度 NA 更多… | |
| int | compare (const char ) const |
| 比较C String NA 更多… | |
| void | append (const std::string &str) |
| 在当前字符串的末尾追加额外的字符 NA NA 更多… | |
| void | appendWithFormat (const char format,…) |
| 追加(w/ 格式) 额外的字符 在当前字符串末尾 NA NA 更多… | |
| __Array | componentsSeparatedByString (const char delimiter) |
| 分开一个string NA NA 更多… | |
| virtual bool | isEqual (const Ref pObject) |
| virtual void | acceptVisitor (DataVisitor &visitor) |
| NA NA 更多… | |
| virtual __String | clone () const |
| NA NA 更多… | |
Public 成员函数 继承自 Ref | |
| void | retain () |
| 保留所有权. 更多… | |
| void | release () |
| 立即释放所有权. 更多… | |
| Ref | autorelease () |
| 自动释放所有权在不久的将来. 更多… | |
| unsigned int | getReferenceCount () const |
| 返回Ref对象当前的引用计数. 更多… | |
| virtual | ~Ref () |
| NA NA 更多… | |
Public 成员函数 继承自 Clonable | |
| virtual | ~Clonable () |
| NA NA 更多… | |
| CC_DEPRECATED_ATTRIBUTE Ref * | copy () const |
| 返回Ref对象的一份拷贝. 更多… | |
| ## 静态 Public 成员函数 | |
| static __String | create (const std::string &str) |
| 根据std string创建一个string, 你也能使用一个 c string 指针 因为默认的 std::string构造 能得到一个 c string 指针. 更多… | |
| static __String | createWithFormat (const char format,…) CC_FORMAT_PRINTF(1 |
| 根据某个格式创建一个string, 它和 c语言 函数 'sprintf'类似, 默认的 buffer 大小是 (1024100) bytes, 如果你想改变这个值, 你需要在String.cpp 文件里面改变 kMaxStringLen 这个宏 . 更多… | |
| static __String static __String | createWithData (const unsigned char pData, size_t nLen) |
| 创建一个二进制数据的字符串 更多… | |
| static __String * | createWithContentsOfFile (const std::string &filename) |
| 创建一个文件名字字符串, 更多… | |
| ## Public 属性 | |
| std::string | _string |
| ## 额外继承的成员函数 | |
Protected 成员函数 继承自 Ref | |
| Ref () | |
| 构造函数 更多… | |
Protected 属性 继承自 Ref | |
| unsigned int | _referenceCount |
| 引用计数 更多… | |
构造及析构函数说明
| __String | ( | ) |
NA NA
| __String | ( | const char * | str | ) |
NA NA
| __String | ( | const std::string & | str | ) |
NA NA
| __String | ( | const __String & | str | ) |
NA NA
| virtual |
NA NA
成员函数说明
| virtual |
NA NA
| void append | ( | const std::string & | str | ) |
在当前字符串的末尾追加额外的字符 NA NA
| void appendWithFormat | ( | const char * | format, |
| … | |||
| ) |
追加(w/ 格式) 额外的字符 在当前字符串末尾 NA NA
| bool boolValue | ( | ) | const |
转化为 bool value NA
| virtual |
NA NA
实现了 Clonable.
| int compare | ( | const char * | ) | const |
比较C String NA
| __Array componentsSeparatedByString | ( | const char | delimiter | ) |
分开一个string NA NA
| static |
根据std string创建一个string, 你也能使用一个 c string 指针 因为默认的 std::string构造 能得到一个 c string 指针.
- 返回
- 一个String pointer是一个 autorelease 对象的 pointer, i这意味着你不需要release 操作 除非 你 retain 了它. NA
| static |
创建一个文件名字字符串,
- 返回
- 这是一个 autorelease object pointer, 所以你不需要release 操作除非你 retain 了它. NA
| static |
创建一个二进制数据的字符串
- 返回
- 这是一个 autorelease object pointer, 所以你不需要release 操作除非你 retain 了它. NA
| static |
根据某个格式创建一个string, 它和 c语言 函数 'sprintf'类似, 默认的 buffer 大小是 (1024*100) bytes, 如果你想改变这个值, 你需要在String.cpp 文件里面改变 kMaxStringLen 这个宏 .
- 返回
- 这是一个 autorelease object pointer, 所以你不需要release 操作除非你 retain 了它. NA
| double doubleValue | ( | ) | const |
转化为 double value NA
| float floatValue | ( | ) | const |
转化为float value NA
| const char* getCString | ( | ) | const |
获取C string NA
| bool initWithFormat | ( | const char * | format, |
| … | |||
| ) |
初始化字符串格式, 和C语言的'sprintf' 函数类似 NA NA
| bool int intValue | ( | ) | const |
转换为int类型 的值 NA
| virtual |
| int length | ( | ) | const |
获取 string长度 NA
| __String& operator= | ( | const __String & | other | ) |
| unsigned int uintValue | ( | ) | const |
转化为unsigned int 的值 NA
类成员变量说明
| std::string _string |
该类的文档由以下文件生成:
- /Users/zeroyang/Documents/github/cocos2d-x/cocos/deprecated/CCString.h
Public 成员函数 继承自 
