22 const auto bufSize =
sizeof(buf);
27 str.
append(item, itemSize);
48 const char *pos =
nullptr;
55 if (mlen == ilen && m.
caseCmp(item, ilen) == 0)
85 static char delim[3][8] = {
91 assert(str && item && pos);
104 *pos += strspn(*pos, delim[2]);
110 *pos += strcspn(*pos, delim[quoted]);
114 }
else if (quoted && **pos ==
'\\') {
126 while (len > 0 &&
xisspace((*item)[len - 1]))
138 const char *pos =
nullptr;
139 const char *item =
nullptr;
141 const auto keyLen = strlen(key);
143 if (
static_cast<size_t>(ilen) > keyLen && strncmp(item, key, keyLen) == 0 && item[keyLen] ==
'=')
144 return SBuf(item + keyLen + 1, ilen - keyLen - 1);
int strListGetItem(const String *str, char del, const char **item, int *ilen, const char **pos)
void strListAdd(String &str, const char *item, const size_t itemSize, const char delimiter)
Appends the given item of a given size to a delimiter-separated list in str.
int strListIsMember(const String *list, const SBuf &m, char del)
SBuf getListMember(const String &list, const char *key, const char delimiter)
int strListIsSubstr(const String *list, const char *s, char del)
int caseCmp(const SBuf &S, const size_type n) const
shorthand version for case-insensitive compare()
const char * rawContent() const
size_type length() const
Returns the number of bytes stored in SBuf.
bool canGrowBy(const size_type growthLen) const
whether appending growthLen characters is safe (i.e., unlikely to assert)
size_type find(char const ch) const
static const size_type npos
char const * termedBuf() const
void append(char const *buf, int len)
static const char * delimiter