26 # define vsnprintf _vsnprintf
46 if (
str.size() > 65536) {
51 str.resize(
str.size() * 2, 0);
60 return string(&
str[0]);
66 if (
a.size() == b.size()) {
67 for (
size_t i = 0; i <
a.size(); i++)
68 if (toupper(
a[i]) != toupper(b[i]))
79 const string &separators,
80 bool skip_empty_tokens)
82 size_t token_start = 0, token_length = 0;
83 for (
size_t i = 0; i <
str.size(); ++i) {
84 const char ch =
str[i];
85 if (separators.find(ch) == string::npos) {
95 if (!skip_empty_tokens || token_length > 0) {
96 string token =
str.substr(token_start, token_length);
97 tokens.push_back(token);
105 string token =
str.substr(token_start, token_length);
106 tokens.push_back(token);
112 size_t len = strlen(start);
117 return strncmp(s.c_str(), start,
len) == 0;
122 size_t len = end.length();
127 return s.compare(s.length() -
len,
len, end) == 0;
141 while ((index = haystack.find(needle, i)) != string::npos) {
142 haystack.replace(index, needle.size(), other);
143 i = index + other.size();
179 wstring string_to_wstring(
const string &
str)
181 const int length_wc = MultiByteToWideChar(CP_UTF8, 0,
str.c_str(),
str.length(),
NULL, 0);
182 wstring str_wc(length_wc, 0);
183 MultiByteToWideChar(CP_UTF8, 0,
str.c_str(),
str.length(), &str_wc[0], length_wc);
187 string string_from_wstring(
const wstring &
str)
189 int length_mb = WideCharToMultiByte(CP_UTF8, 0,
str.c_str(),
str.size(),
NULL, 0,
NULL,
NULL);
190 string str_mb(length_mb, 0);
191 WideCharToMultiByte(CP_UTF8, 0,
str.c_str(),
str.size(), &str_mb[0], length_mb,
NULL,
NULL);
195 string string_to_ansi(
const string &
str)
197 const int length_wc = MultiByteToWideChar(CP_UTF8, 0,
str.c_str(),
str.length(),
NULL, 0);
198 wstring str_wc(length_wc, 0);
199 MultiByteToWideChar(CP_UTF8, 0,
str.c_str(),
str.length(), &str_wc[0], length_wc);
201 int length_mb = WideCharToMultiByte(
202 CP_ACP, 0, str_wc.c_str(), str_wc.size(),
NULL, 0,
NULL,
NULL);
204 string str_mb(length_mb, 0);
205 WideCharToMultiByte(CP_ACP, 0, str_wc.c_str(), str_wc.size(), &str_mb[0], length_mb,
NULL,
NULL);
214 static const char suffixes[] =
"BKMGTPEZY";
216 const char *suffix = suffixes;
219 while (
size >= 1024) {
245 if (++i && i % 3 == 0)
248 *(--p) =
'0' + (num % 10);
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
#define CCL_NAMESPACE_END
string string_remove_trademark(const string &s)
string string_from_bool(bool var)
string string_human_readable_size(size_t size)
bool string_iequals(const string &a, const string &b)
string string_strip(const string &s)
string to_string(const char *str)
string string_human_readable_number(size_t num)
bool string_startswith(const string &s, const char *start)
bool string_endswith(const string &s, const string &end)
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)
void string_split(vector< string > &tokens, const string &str, const string &separators, bool skip_empty_tokens)
void string_replace(string &haystack, const string &needle, const string &other)