X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/7341eedbaf526ef2f0986b576c656906050e270a..bf1894da7758957db6a95289cece30281b5c2f5f:/String.hpp?ds=sidebyside diff --git a/String.hpp b/String.hpp index b5df7d4..fe33fcb 100644 --- a/String.hpp +++ b/String.hpp @@ -54,6 +54,11 @@ struct CYUTF8String { return length == size && memcmp(value, data, length) == 0; } + bool operator !=(const char *value) const { + size_t length(strlen(data)); + return length != size || memcmp(value, data, length) != 0; + } + operator std::string() const { return std::string(data, size); } @@ -82,6 +87,10 @@ bool CYGetOffset(const char *value, ssize_t &index); bool CYStartsWith(const CYUTF8String &haystack, const CYUTF8String &needle); +const char *CYPoolCString(CYPool &pool, CYUTF8String utf8); +CYUTF8String CYPoolUTF8String(CYPool &pool, CYUTF8String utf8); +CYUTF8String CYPoolUTF8String(CYPool &pool, const std::string &value); + CYUTF8String CYPoolUTF8String(CYPool &pool, CYUTF16String utf16); CYUTF16String CYPoolUTF16String(CYPool &pool, CYUTF8String utf8);