10#include "mem/forward.h"
61 if (0 == this->
cmp(that))
70 if (0 == this->
cmp(that))
92 memcpy(
buf_, str, len);
206 if (newLength >
len_)
return;
214 buf_[newLength] =
'\0';
220nilCmp(
const bool thisIsNilOrEmpty,
const bool otherIsNilOrEmpty,
int &result)
222 if (!thisIsNilOrEmpty && !otherIsNilOrEmpty)
225 if (thisIsNilOrEmpty && otherIsNilOrEmpty)
227 else if (thisIsNilOrEmpty)
239 if (
nilCmp(!
size(), (!aString || !*aString), result))
249 if (
nilCmp((!
size() || !count), (!aString || !*aString || !count), result))
252 return strncmp(
termedBuf(), aString, count);
269 if (
nilCmp(!
size(), (!aString || !*aString), result))
279 if (
nilCmp((!
size() || !count), (!aString || !*aString || !count), result))
282 return strncasecmp(
termedBuf(), aString, count);
289 return strpbrk(s,
w_space) !=
nullptr;
298 while ((c = (
unsigned char) *s++) !=
'\0') {
302 if (c >= 0x7f && c <= 0x9f)
316 unsigned char *word =
nullptr;
317 unsigned char *p = (
unsigned char *) buf;
323 p = (
unsigned char *) *t;
395 return (
char *) word;
401 return p ? p :
"(NULL)";
static bool nilCmp(const bool thisIsNilOrEmpty, const bool otherIsNilOrEmpty, int &result)
int stringHasCntl(const char *s)
int stringHasWhitespace(const char *s)
char * strwordtok(char *buf, char **t)
const char * checkNullString(const char *p)
void error(char *format,...)
bool canGrowBy(const size_type growthLen) const
whether appending growthLen characters is safe (i.e., unlikely to assert)
int cmp(char const *) const
String substr(size_type from, size_type to) const
void setBuffer(char *buf, size_type sz)
size_type find(char const ch) const
static const size_type npos
void assign(const char *str, int len)
const char * pos(char const *aString) const
bool operator==(String const &) const
size_type rfind(char const ch) const
char const * rawBuf() const
void allocAndFill(const char *str, int len)
void allocBuffer(size_type sz)
void cut(size_type newLength)
char const * termedBuf() const
void append(char const *buf, int len)
int caseCmp(char const *) const
void reset(char const *str)
static const size_type SizeMax_
String & operator=(char const *)
const char * rpos(char const ch) const
bool operator!=(String const &) const
void memFreeString(size_t size, void *)
void * memAllocString(size_t net_size, size_t *gross_size)
char * xstrncpy(char *dst, const char *src, size_t n)