#ifdef NALL_STRING_INTERNAL_HPP namespace nall { unsigned string::length() const { return strlen(data); } unsigned string::capacity() const { return size; } template lstring string::split(const char *key) const { lstring result; result.split(key, data); return result; } template lstring string::isplit(const char *key) const { lstring result; result.isplit(key, data); return result; } template lstring string::qsplit(const char *key) const { lstring result; result.qsplit(key, data); return result; } template lstring string::iqsplit(const char *key) const { lstring result; result.iqsplit(key, data); return result; } bool string::equals(const char *str) const { return !strcmp(data, str); } bool string::iequals(const char *str) const { return !istrcmp(data, str); } bool string::wildcard(const char *str) const { return nall::wildcard(data, str); } bool string::iwildcard(const char *str) const { return nall::iwildcard(data, str); } bool string::beginswith(const char *str) const { return strbegin(data, str); } bool string::ibeginswith(const char *str) const { return istrbegin(data, str); } bool string::endswith(const char *str) const { return strend(data, str); } bool string::iendswith(const char *str) const { return istrend(data, str); } string& string::lower() { nall::strlower(data); return *this; } string& string::upper() { nall::strupper(data); return *this; } string& string::qlower() { nall::qstrlower(data); return *this; } string& string::qupper() { nall::qstrupper(data); return *this; } string& string::transform(const char *before, const char *after) { nall::strtr(data, before, after); return *this; } string& string::reverse() { unsigned length = strlen(data), pivot = length >> 1; for(signed x = 0, y = length - 1; x < pivot && y >= 0; x++, y--) std::swap(data[x], data[y]); return *this; } template string& string::ltrim(const char *key) { nall::ltrim(data, key); return *this; } template string& string::rtrim(const char *key) { nall::rtrim(data, key); return *this; } template string& string::trim(const char *key, const char *rkey) { nall::trim (data, key, rkey); return *this; } string& string::strip() { nall::strip(data); return *this; } optional string::position(const char *key) const { return strpos(data, key); } optional string::iposition(const char *key) const { return istrpos(data, key); } optional string::qposition(const char *key) const { return qstrpos(data, key); } optional string::iqposition(const char *key) const { return iqstrpos(data, key); } } #endif