X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/f95d2598051e347460e028286ff2d33e5825e548..77dd5db92b788d747c11ee9c78d79df5b88e7a1d:/Code.hpp diff --git a/Code.hpp b/Code.hpp index 93f2e54..1c52c0b 100644 --- a/Code.hpp +++ b/Code.hpp @@ -1,5 +1,5 @@ -/* Cycript - Optimizing JavaScript Compiler/Runtime - * Copyright (C) 2009-2014 Jay Freeman (saurik) +/* Cycript - The Truly Universal Scripting Language + * Copyright (C) 2009-2016 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