1. Sylvain Rouquette
  2. pyGAP

Source

pyGAP / game / engine / io / file / base.h

#ifndef __IO_FILE_BASE_H__
#define __IO_FILE_BASE_H__

#include <cstddef>
#include <stdint.h>


namespace io { namespace file {


class Base {
public:
    Base() {}
    virtual ~Base() {}

    virtual bool open(const char* filename, const char* mode) = 0;
    virtual bool is_open() const = 0;
    virtual void close() = 0;

    virtual void seek(uint64_t offset) = 0;
    virtual uint64_t tell() const = 0;

    virtual size_t read(uint8_t* buffer, size_t size, size_t count) = 0;
    virtual size_t write(const uint8_t* buffer, size_t size, size_t count) = 0;

    virtual size_t size() = 0;
    virtual uint8_t* read() = 0;
};


} /* namespace file */ } /* namespace io */


#endif