Gnash  0.8.11dev
CodeStream.h
Go to the documentation of this file.
1 // CodeStream.h A class which allows bounds-checked reading from a char array
2 //
3 // Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012
4 // Free Software Foundation, Inc.
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 
20 #ifndef GNASH_CODESTREAM_H
21 #define GNASH_CODESTREAM_H
22 
23 #include <string>
24 #include <boost/utility.hpp>
25 #include <cstdint>
26 #include <istream>
27 #include <sstream>
28 
29 namespace gnash {
30 
34 
40 class CodeStream : public std::istream, private boost::noncopyable
41 {
42 public:
43  CodeStream(std::string data): std::istream(new std::stringbuf(data)){
44 
45  }
46 
48 std::uint32_t read_V32();
49 
51 std::uint8_t read_as3op();
52 
54 void seekBy(int change);
55 
57 void seekTo(unsigned int set);
58 
60 std::int32_t read_S24();
61 
63 int8_t read_s8();
64 
66 std::uint8_t read_u8();
67 
70 void skip_V32();
71 
72 };
73 
74 } // namespace gnash
75 #endif
CodeStream(std::string data)
Definition: CodeStream.h:43
SimpleBuffer data
Definition: LocalConnection_as.cpp:151
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
Definition: CodeStream.h:40
Definition: CodeStream.h:33