22 #ifndef NUVIE_FILES_NUVIE_IO_H 23 #define NUVIE_FILES_NUVIE_IO_H 25 #include "common/stream.h" 40 virtual void close() {
45 virtual uint8 read1() {
48 virtual uint16 read2() {
51 virtual uint32 read4() {
55 unsigned char *readAll();
56 unsigned char *readBuf(uint32 read_size, uint32 *bytes_read);
57 virtual bool readToBuf(
unsigned char *buf, uint32 buf_size) {
62 virtual bool write1(uint8 src) {
65 virtual bool write2(uint16 src) {
68 virtual bool write4(uint32 src) {
71 virtual uint32 writeBuf(
const unsigned char *src, uint32 src_size) {
74 virtual uint32 write(
NuvieIO *src) {
78 uint32 get_size()
const {
83 inline void seekStart() {
86 inline void seekEnd() {
89 virtual void seek(uint32 new_pos) = 0;
91 inline bool is_end()
const {
92 return (pos == size - 1);
94 inline bool is_eof()
const {
95 return (size == 0 || pos >= size);
97 uint32 position()
const {
102 #define NUVIE_BUF_COPY true 103 #define NUVIE_BUF_NOCOPY false 116 bool open(
unsigned char *buf, uint32 buf_size,
bool copy_buf = NUVIE_BUF_COPY);
118 void close()
override;
120 unsigned char *get_raw_data() {
124 uint8 read1()
override;
125 uint16 read2()
override;
126 uint32 read4()
override;
127 bool readToBuf(
unsigned char *buf, uint32 buf_size)
override;
129 bool write1(uint8 src)
override;
130 bool write2(uint16 src)
override;
131 bool write4(uint32 src)
override;
132 uint32 writeBuf(
const unsigned char *src, uint32 src_size)
override;
133 uint32 write(
NuvieIO *src)
override;
135 void seek(uint32 new_pos)
override;
Definition: detection.h:27
Definition: nuvie_io.h:106
Definition: nuvie_io.h:32