Go to the documentation of this file.
21 #ifndef GNASH_IOCHANNEL_H
22 #define GNASH_IOCHANNEL_H
53 std::uint32_t read_le32();
59 std::uint16_t read_le16();
65 std::uint8_t read_byte();
74 virtual std::streamsize
read(
void* dst, std::streamsize num)=0;
89 return read(dst, num);
96 virtual std::streamsize
write(
const void* src, std::streamsize num);
111 int read_string(
char* dst,
int max_length);
117 virtual std::streampos
tell()
const = 0;
126 virtual bool seek(std::streampos
p) = 0;
138 virtual bool eof()
const = 0;
144 virtual bool bad()
const = 0;
155 virtual size_t size()
const {
return static_cast<size_t>(-1); }
161 #endif // GNASH_IOCHANNEL_H
std::uint16_t read_le16()
Read a 16-bit word from a little-endian stream.
Definition: IOChannel.cpp:39
Top-level gnash exception.
Definition: GnashException.h:31
virtual bool eof() const =0
Return true if the end of the stream has been reached.
@ i
Definition: GnashKey.h:155
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
@ s
Definition: GnashKey.h:165
virtual bool seek(std::streampos p)=0
Seek to the specified position.
virtual ~IOChannel()
Definition: IOChannel.h:46
IOException(const std::string &s)
Definition: IOChannel.h:37
A virtual IO channel.
Definition: IOChannel.h:43
void write(SimpleBuffer &buf, const std::string &str)
Write a string to an AMF buffer.
Definition: AMF.cpp:161
Exception signalling an IO error.
Definition: IOChannel.h:35
std::uint32_t read_le32()
Read a 32-bit word from a little-endian stream. returning it as a native-endian word.
Definition: IOChannel.cpp:28
virtual size_t size() const
Get the size of the stream (unreliably).
Definition: IOChannel.h:155
@ p
Definition: GnashKey.h:162
IOException()
Definition: IOChannel.h:38
virtual std::streamsize write(const void *src, std::streamsize num)
Write the given number of bytes to the stream.
Definition: IOChannel.cpp:74
virtual std::streamsize readNonBlocking(void *dst, std::streamsize num)
Read at most the given number of bytes w/out blocking.
Definition: IOChannel.h:87
std::uint8_t read_byte()
Read a single byte from the stream.
Definition: IOChannel.cpp:63
#define DSOEXPORT
Definition: dsodefs.h:55
virtual void go_to_end()=0
Seek to the end of the stream.
virtual std::streampos tell() const =0
Return current stream position.
int read_string(char *dst, int max_length)
Read up to max_length characters, returns the number of characters read, or -1 if the string length i...
Definition: IOChannel.cpp:47
@ u
Definition: GnashKey.h:167
virtual bool bad() const =0
Return true if the stream is in an error state.
virtual std::streamsize read(void *dst, std::streamsize num)=0
Read the given number of bytes from the stream.