16 # define vsnprintf _vsnprintf
36 if (
str.size() > 65536) {
41 str.resize(
str.size() * 2, 0);
50 return string(&
str[0]);
56 if (
a.size() ==
b.size()) {
57 for (
size_t i = 0; i <
a.size(); i++)
58 if (toupper(
a[i]) != toupper(
b[i]))
69 const string &separators,
70 bool skip_empty_tokens)
72 size_t token_start = 0, token_length = 0;
73 for (
size_t i = 0; i <
str.size(); ++i) {
74 const char ch =
str[i];
75 if (separators.find(ch) == string::npos) {
85 if (!skip_empty_tokens || token_length > 0) {
86 string token =
str.substr(token_start, token_length);
87 tokens.push_back(token);
95 string token =
str.substr(token_start, token_length);
96 tokens.push_back(token);
102 const size_t len = start.size();
104 if (
len > s.size()) {
108 return strncmp(s.c_str(), start.data(),
len) == 0;
113 const size_t len = end.size();
115 if (
len > s.size()) {
119 return strncmp(s.c_str() + s.size() -
len, end.data(),
len) == 0;
133 while ((index = haystack.find(needle, i)) != string::npos) {
134 haystack.replace(index, needle.size(), other);
135 i = index + other.size();
141 assert(needle.size() == other.size());
143 while (
pos != string::npos) {
144 pos = haystack.find(needle,
pos);
145 if (
pos != string::npos) {
146 memcpy(haystack.data() +
pos, other.data(), other.size());
188 std::transform(
r.begin(),
r.end(),
r.begin(), [](
char c) { return std::tolower(c); });
196 wstring string_to_wstring(
const string &
str)
198 const int length_wc = MultiByteToWideChar(CP_UTF8, 0,
str.c_str(),
str.length(),
NULL, 0);
199 wstring str_wc(length_wc, 0);
200 MultiByteToWideChar(CP_UTF8, 0,
str.c_str(),
str.length(), &str_wc[0], length_wc);
204 string string_from_wstring(
const wstring &
str)
206 int length_mb = WideCharToMultiByte(CP_UTF8, 0,
str.c_str(),
str.size(),
NULL, 0,
NULL,
NULL);
207 string str_mb(length_mb, 0);
208 WideCharToMultiByte(CP_UTF8, 0,
str.c_str(),
str.size(), &str_mb[0], length_mb,
NULL,
NULL);
212 string string_to_ansi(
const string &
str)
214 const int length_wc = MultiByteToWideChar(CP_UTF8, 0,
str.c_str(),
str.length(),
NULL, 0);
215 wstring str_wc(length_wc, 0);
216 MultiByteToWideChar(CP_UTF8, 0,
str.c_str(),
str.length(), &str_wc[0], length_wc);
218 int length_mb = WideCharToMultiByte(
219 CP_ACP, 0, str_wc.c_str(), str_wc.size(),
NULL, 0,
NULL,
NULL);
221 string str_mb(length_mb, 0);
222 WideCharToMultiByte(CP_ACP, 0, str_wc.c_str(), str_wc.size(), &str_mb[0], length_mb,
NULL,
NULL);
231 static const char suffixes[] =
"BKMGTPEZY";
233 const char *suffix = suffixes;
236 while (
size >= 1024) {
262 if (++i && i % 3 == 0)
265 *(--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
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
#define CCL_NAMESPACE_END
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
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_view s, const string_view start)
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)
void string_replace_same_length(string &haystack, const string &needle, const string &other)
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)
bool string_endswith(const string_view s, const string_view end)
string string_to_lower(const string &s)