Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GNASH_IOCHANNEL_H
00022 #define GNASH_IOCHANNEL_H
00023
00024 #include "dsodefs.h"
00025 #include "GnashException.h"
00026
00027 #include <string>
00028 #include <boost/cstdint.hpp>
00029 #include <ios>
00030
00031 namespace gnash {
00032
00034 class DSOEXPORT IOException : public GnashException {
00035 public:
00036 IOException(const std::string& s) : GnashException(s) {}
00037 IOException() : GnashException("IO error") {}
00038 };
00039
00041 class DSOEXPORT IOChannel
00042 {
00043 public:
00044
00045 virtual ~IOChannel() {}
00046
00049
00052 boost::uint32_t read_le32();
00053
00055
00058 boost::uint16_t read_le16();
00059
00061
00064 boost::uint8_t read_byte();
00065
00067
00073 virtual std::streamsize read(void* dst, std::streamsize num)=0;
00074
00076
00086 virtual std::streamsize readNonBlocking(void* dst, std::streamsize num)
00087 {
00088 return read(dst, num);
00089 }
00090
00092
00095 virtual std::streamsize write(const void* src, std::streamsize num);
00096
00100
00110 int read_string(char* dst, int max_length);
00111
00113
00119 float read_float32();
00120
00122
00125 virtual std::streampos tell() const = 0;
00126
00128
00134 virtual bool seek(std::streampos p) = 0;
00135
00137
00140 virtual void go_to_end() = 0;
00141
00143
00146 virtual bool eof() const = 0;
00147
00149
00152 virtual bool bad() const = 0;
00153
00155
00163 virtual size_t size() const { return static_cast<size_t>(-1); }
00164
00165 };
00166
00167 }
00168
00169 #endif // GNASH_IOCHANNEL_H
00170
00171
00172
00173
00174
00175