X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/9cad30fab188a57c3db8df0912a1691099468e64..1504c9b837a7561d8ae2c81f1c4d57fe0f138781:/String.hpp?ds=inline diff --git a/String.hpp b/String.hpp index 754cdbc..ec45c47 100644 --- a/String.hpp +++ b/String.hpp @@ -43,10 +43,18 @@ #include "cycript.hpp" #include "Pooling.hpp" +#include + struct CYUTF8String { const char *data; size_t size; + CYUTF8String(const char *data) : + data(data), + size(strlen(data)) + { + } + CYUTF8String(const char *data, size_t size) : data(data), size(size) @@ -59,6 +67,11 @@ struct CYUTF8String { } }; +static inline std::ostream &operator <<(std::ostream &lhs, CYUTF8String &rhs) { + lhs.write(rhs.data, rhs.size); + return lhs; +} + struct CYUTF16String { const uint16_t *data; size_t size;