X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/6447ef4983dec9dee9ce857d78822a2229edd449..5587a93f98c158ab5e71c1f1c6b318690271d335:/Code.hpp diff --git a/Code.hpp b/Code.hpp new file mode 100644 index 0000000..324c00f --- /dev/null +++ b/Code.hpp @@ -0,0 +1,52 @@ +/* Cycript - Optimizing JavaScript Compiler/Runtime + * Copyright (C) 2009-2013 Jay Freeman (saurik) +*/ + +/* GNU 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 + * 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 . +**/ +/* }}} */ + +#ifndef CODE_HPP +#define CODE_HPP + +#include + +#include "String.hpp" + +class CYStream : + public std::istream +{ + 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) + { + } +}; + +CYUTF8String CYPoolCode(CYPool &pool, std::istream &stream); + +#endif//CODE_HPP