2011-10-02 10:05:45 +00:00
|
|
|
#ifdef NALL_STRING_INTERNAL_HPP
|
2010-10-14 10:07:38 +00:00
|
|
|
|
|
|
|
namespace nall {
|
|
|
|
|
|
|
|
unsigned string::length() const { return strlen(data); }
|
2011-12-12 10:59:53 +00:00
|
|
|
unsigned string::capacity() const { return size; }
|
2010-10-14 10:07:38 +00:00
|
|
|
|
2011-10-16 09:44:48 +00:00
|
|
|
template<unsigned limit> lstring string::split(const char *key) const { lstring result; result.split<limit>(key, data); return result; }
|
|
|
|
template<unsigned limit> lstring string::isplit(const char *key) const { lstring result; result.isplit<limit>(key, data); return result; }
|
|
|
|
template<unsigned limit> lstring string::qsplit(const char *key) const { lstring result; result.qsplit<limit>(key, data); return result; }
|
|
|
|
template<unsigned limit> lstring string::iqsplit(const char *key) const { lstring result; result.iqsplit<limit>(key, data); return result; }
|
|
|
|
|
2010-10-14 10:07:38 +00:00
|
|
|
bool string::equals(const char *str) const { return !strcmp(data, str); }
|
2011-08-06 14:03:52 +00:00
|
|
|
bool string::iequals(const char *str) const { return !istrcmp(data, str); }
|
2010-10-14 10:07:38 +00:00
|
|
|
|
|
|
|
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); }
|
2011-08-06 14:03:52 +00:00
|
|
|
bool string::ibeginswith(const char *str) const { return istrbegin(data, str); }
|
2010-10-14 10:07:38 +00:00
|
|
|
|
|
|
|
bool string::endswith(const char *str) const { return strend(data, str); }
|
2011-08-06 14:03:52 +00:00
|
|
|
bool string::iendswith(const char *str) const { return istrend(data, str); }
|
2010-10-14 10:07:38 +00:00
|
|
|
|
|
|
|
string& string::lower() { nall::strlower(data); return *this; }
|
|
|
|
string& string::upper() { nall::strupper(data); return *this; }
|
2011-07-07 12:59:26 +00:00
|
|
|
string& string::qlower() { nall::qstrlower(data); return *this; }
|
|
|
|
string& string::qupper() { nall::qstrupper(data); return *this; }
|
2010-10-14 10:07:38 +00:00
|
|
|
string& string::transform(const char *before, const char *after) { nall::strtr(data, before, after); return *this; }
|
|
|
|
|
|
|
|
template<unsigned limit> string& string::ltrim(const char *key) { nall::ltrim<limit>(data, key); return *this; }
|
|
|
|
template<unsigned limit> string& string::rtrim(const char *key) { nall::rtrim<limit>(data, key); return *this; }
|
2011-08-06 14:03:52 +00:00
|
|
|
template<unsigned limit> string& string::trim(const char *key, const char *rkey) { nall::trim <limit>(data, key, rkey); return *this; }
|
2010-10-14 10:07:38 +00:00
|
|
|
|
|
|
|
optional<unsigned> string::position(const char *key) const { return strpos(data, key); }
|
2011-08-06 14:03:52 +00:00
|
|
|
optional<unsigned> string::iposition(const char *key) const { return istrpos(data, key); }
|
2010-10-14 10:07:38 +00:00
|
|
|
optional<unsigned> string::qposition(const char *key) const { return qstrpos(data, key); }
|
2011-08-06 14:03:52 +00:00
|
|
|
optional<unsigned> string::iqposition(const char *key) const { return iqstrpos(data, key); }
|
2010-10-14 10:07:38 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|