50 int len = strlen(chars);
54 m_chars.
set(chars, len + 1);
62 int len = int(end-start);
66 m_chars.
set(start, len + 1);
85 int len = _vscprintf(fmt, args);
89 m_chars.
reset(len + 1);
90 vsprintf_s(m_chars.
getPtr(), len + 1, fmt, args);
101 res.m_chars.
reset(end - start + 1);
103 res.m_chars[end - start] =
'\0';
112 for (
int i=0; i <
len; i++)
113 if (!isspace(m_chars[i]))
123 for (
int i=len-1; i >= 0; i--)
124 if (!isspace(m_chars[i]))
136 for (
int i=0; i <
len; i++)
138 if (!isspace(m_chars[i]))
148 for (
int i=len-1; i >= 0; i--)
149 if (!isspace(m_chars[i]))
165 if (c != n || includeEmpty)
178 m_chars[len + 1] =
'\0';
187 int lenB = strlen(chars);
188 m_chars.
resize(lenA + lenB + 1);
190 m_chars[lenA + lenB] =
'\0';
202 return append(tmp.getPtr());
221 int lenB = _vscprintf(fmt, args);
222 m_chars.
resize(lenA + lenB + 1);
223 vsprintf_s(m_chars.
getPtr(lenA), lenB + 1, fmt, args);
233 for (
int i = 0; i < m_chars.
getSize(); i++)
236 if (c >=
'a' && c <=
'z')
249 for (
int i = 0; i < m_chars.
getSize(); i++)
252 if (c >=
'A' && c <=
'Z')
264 const char* b = str.
getPtr();
265 for (
int ofs = 0; b[ofs]; ofs++)
266 if (a[ofs] != b[ofs])
295 return (idx == -1) ?
"." :
substring(0, idx);
300 int String::strlen(
const char* chars)
313 int String::strcmp(
const char* a,
const char* b)
316 while (a[ofs] && a[ofs] == b[ofs])
318 return a[ofs] - b[ofs];
330 if (ctime_s(buffer,
sizeof(buffer), &currTime) != 0)
331 fail(
"ctime_s() failed!");
336 while (*ptr && *ptr !=
'\n' && *ptr !=
'\r')
347 while (*ptr ==
' ' || *ptr ==
'\t')
368 const char* tmp =
ptr;
370 while (*str && *tmp == *str)
386 const char* tmp =
ptr;
389 if (*tmp < '0' || *tmp >
'9')
391 while (*tmp >=
'0' && *tmp <=
'9')
392 v = v * 10 + *tmp++ -
'0';
394 value = (neg) ? -v : v;
403 const char* tmp =
ptr;
406 if (*tmp < '0' || *tmp >
'9')
408 while (*tmp >=
'0' && *tmp <=
'9')
409 v = v * 10 + *tmp++ -
'0';
411 value = (neg) ? -v : v;
420 const char* tmp =
ptr;
424 if (*tmp >=
'0' && *tmp <=
'9') v = v * 16 + *tmp++ -
'0';
425 else if (*tmp >=
'A' && *tmp <=
'F') v = v * 16 + *tmp++ -
'A' + 10;
426 else if (*tmp >=
'a' && *tmp <=
'f') v = v * 16 + *tmp++ -
'a' + 10;
442 const char* tmp =
ptr;
447 while (*tmp >=
'0' && *tmp <=
'9')
449 v = v * 10.0f + (
F32)(*tmp++ -
'0');
455 while (*tmp >=
'0' && *tmp <=
'9')
458 v += scale * (
F32)(*tmp++ -
'0');
470 value =
bitsToFloat((neg) ? 0xFF800000 : 0x7F800000);
475 value =
bitsToFloat((neg) ? 0xFF800001 : 0x7F800001);
480 value =
bitsToFloat((neg) ? 0xFFC00001 : 0x7FC00001);
485 value =
bitsToFloat((neg) ? 0xFFC00000 : 0x7FC00000);
497 value = (neg) ? -v : v;
508 for(
int j = 0; j < 3; j++)
String trimEnd(void) const
String & append(char chr)
String substring(int start, int end) const
bool endsWith(const String &str) const
const char * getPtr(void) const
static void copy(T *dst, const T *src, S32size)
String & setf(const char *fmt,...)
String getFileName(void) const
String & appendfv(const char *fmt, va_list args)
int indexOf(char chr) const
FW_CUDA_FUNC F32 scale(F32 a, int b)
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer
bool parseVec3f(const char *&ptr, Vec3f &value)
FW_CUDA_FUNC F64 pow(F64 a, F64 b)
String & setfv(const char *fmt, va_list args)
String toLower(void) const
int lastIndexOf(char chr) const
bool parseLiteral(const char *&ptr, const char *str)
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v
FW_CUDA_FUNC T max(const VectorBase< T, L, S > &v)
int getLength(void) const
String getDirName(void) const
String trimStart(void) const
CUdevice int ordinal char int len
bool parseInt(const char *&ptr, S32 &value)
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction f
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei n
bool parseFloat(const char *&ptr, F32 &value)
String & appendf(const char *fmt,...)
bool startsWith(const String &str) const
bool parseSpace(const char *&ptr)
void split(char chr, Array< String > &pieces, bool includeEmpty=false) const
T set(S idx, const T &item)
bool parseHex(const char *&ptr, U32 &value)
const T * getPtr(S idx=0) const
void fail(const char *fmt,...)
String getDateString(void)
bool parseChar(const char *&ptr, char chr)
String toUpper(void) const