X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/f95d2598051e347460e028286ff2d33e5825e548..8d20f0f1540c4c116f52e333edc57a4f549927e8:/Code.hpp?ds=sidebyside diff --git a/Code.hpp b/Code.hpp index 93f2e54..15a5ffb 100644 --- a/Code.hpp +++ b/Code.hpp @@ -1,5 +1,5 @@ /* Cycript - Optimizing JavaScript Compiler/Runtime - * Copyright (C) 2009-2014 Jay Freeman (saurik) + * Copyright (C) 2009-2015 Jay Freeman (saurik) */ /* GNU Affero General Public License, Version 3 {{{ */ @@ -27,26 +27,15 @@ #include "String.hpp" class CYStream : - public std::istream + public std::streambuf { - private: - class CYBuffer : - public std::streambuf - { - public: - CYBuffer(const char *start, const char *end) { - setg(const_cast(start), const_cast(start), const_cast(end)); - } - } buffer_; - public: - CYStream(const char *start, const char *end) : - std::istream(&buffer_), - buffer_(start, end) - { + CYStream(const char *start, const char *end) { + setg(const_cast(start), const_cast(start), const_cast(end)); } }; -CYUTF8String CYPoolCode(CYPool &pool, std::istream &stream); +CYUTF8String CYPoolCode(CYPool &pool, std::streambuf &stream); +CYUTF8String CYPoolCode(CYPool &pool, CYUTF8String code); #endif//CODE_HPP