Formatting

This commit is contained in:
Maschell
2020-05-17 19:05:51 +02:00
parent 373579cd6f
commit 2ee3011ae8
39 changed files with 881 additions and 810 deletions

View File

@@ -18,18 +18,22 @@ public:
};
CFile();
CFile(const std::string & filepath, eOpenTypes mode);
CFile(const uint8_t * memory, int32_t memsize);
CFile(const std::string &filepath, eOpenTypes mode);
CFile(const uint8_t *memory, int32_t memsize);
virtual ~CFile();
int32_t open(const std::string & filepath, eOpenTypes mode);
int32_t open(const uint8_t * memory, int32_t memsize);
int32_t open(const std::string &filepath, eOpenTypes mode);
int32_t open(const uint8_t *memory, int32_t memsize);
BOOL isOpen() const {
if(iFd >= 0)
if (iFd >= 0)
return true;
if(mem_file)
if (mem_file)
return true;
return false;
@@ -37,23 +41,29 @@ public:
void close();
int32_t read(uint8_t * ptr, size_t size);
int32_t write(const uint8_t * ptr, size_t size);
int32_t read(uint8_t *ptr, size_t size);
int32_t write(const uint8_t *ptr, size_t size);
int32_t fwrite(const char *format, ...);
int32_t seek(long int offset, int32_t origin);
uint64_t tell() {
return pos;
};
uint64_t size() {
return filesize;
};
void rewind() {
this->seek(0, SEEK_SET);
};
protected:
int32_t iFd;
const uint8_t * mem_file;
const uint8_t *mem_file;
uint64_t filesize;
uint64_t pos;
};