X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/5587a93f98c158ab5e71c1f1c6b318690271d335..8d20f0f1540c4c116f52e333edc57a4f549927e8:/Code.hpp diff --git a/Code.hpp b/Code.hpp index 324c00f..15a5ffb 100644 --- a/Code.hpp +++ b/Code.hpp @@ -1,21 +1,21 @@ /* Cycript - Optimizing JavaScript Compiler/Runtime - * Copyright (C) 2009-2013 Jay Freeman (saurik) + * Copyright (C) 2009-2015 Jay Freeman (saurik) */ -/* GNU General Public License, Version 3 {{{ */ +/* GNU Affero General Public License, Version 3 {{{ */ /* - * Cycript is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published - * by the Free Software Foundation, either version 3 of the License, - * or (at your option) any later version. - * - * Cycript is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Cycript. If not, see . + * GNU Affero General Public License for more details. + + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . **/ /* }}} */ @@ -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