C:/Projets/hexamonkey/core/file/file.h
Go to the documentation of this file.
00001 
00002 #ifndef FILE_H
00003 #define FILE_H
00004 
00005 
00006 #include <iostream>
00007 #include <fstream>
00008 #include <stdint.h>
00009 #include <map>
00010 
00015 class File
00016 {
00017 public:
00018     File();
00019 
00021     virtual void setPath(const std::string& path) = 0;
00022 
00024     virtual const std::string& path() const = 0;
00025 
00027     virtual void open() = 0;
00028 
00030     virtual void close() = 0;
00031 
00033     virtual void clear() = 0;
00034 
00035 
00040     virtual void read(char* s, int64_t size) = 0;
00041 
00049     virtual void seekg(int64_t off, std::ios_base::seekdir dir) = 0;
00050 
00052     virtual int64_t tellg() = 0;
00053 
00055     virtual int64_t size() = 0;
00056 
00058     virtual bool good() = 0;
00059 
00060 protected:
00061     char _bitPosition;
00062 
00063 private:
00064     File& operator=(const File&) = delete;
00065     File(const File&) = delete;
00066 };
00067 
00072 class FileAnchor
00073 {
00074 public:
00075     FileAnchor(File& file);
00076     ~FileAnchor();
00077 private:
00078     File& file;
00079     int64_t position;
00080 };
00081 
00082 #endif // FILE_H