X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/c1d3e52e58e86c49f9d04e06ae8e0ece4b98250c..972562bf68a236b4580b6074415cbf4e07b0a0c6:/String.hpp?ds=sidebyside diff --git a/String.hpp b/String.hpp index a00a5e2..e0e292e 100644 --- a/String.hpp +++ b/String.hpp @@ -22,11 +22,10 @@ #ifndef CYCRIPT_STRING_HPP #define CYCRIPT_STRING_HPP -#include "cycript.hpp" -#include "Pooling.hpp" - #include +#include "Pooling.hpp" + struct CYUTF8String { const char *data; size_t size; @@ -55,7 +54,7 @@ struct CYUTF8String { } }; -static inline std::ostream &operator <<(std::ostream &lhs, CYUTF8String &rhs) { +static inline std::ostream &operator <<(std::ostream &lhs, const CYUTF8String &rhs) { lhs.write(rhs.data, rhs.size); return lhs; } @@ -75,6 +74,8 @@ size_t CYGetIndex(const CYUTF8String &value); bool CYIsKey(CYUTF8String value); bool CYGetOffset(const char *value, ssize_t &index); +bool CYStartsWith(const CYUTF8String &haystack, const CYUTF8String &needle); + CYUTF8String CYPoolUTF8String(CYPool &pool, CYUTF16String utf16); CYUTF16String CYPoolUTF16String(CYPool &pool, CYUTF8String utf8);