载入中...
搜索中...
未找到
File.h
浏览该文件的文档.
1#pragma once
2
3#include <cstdio>
4
5#include "filesystem/File.h"
6
7namespace eve {
8namespace filesystem {
9
10namespace cppfs {
11
17public:
19 File(std::string filename);
21 virtual ~File();
22
23 // Implements eve::filesystem::File.
27 bool open(std::string newmode) override;
29 bool close() override;
31 bool isOpen() const override;
33 int64_t getSize() override;
35 int64_t read(void *dst, int64_t size) override;
37 bool write(const void *data, int64_t size) override;
39 bool flush() override;
41 bool isEOF() override;
43 int64_t tell() override;
45 bool seek(uint64_t pos) override;
47 bool setBuffer(std::string bufmode, int64_t size) override;
49 std::string getBuffer(int64_t &size) const override;
51 std::string getMode() const override;
53 std::string getFilename() const override;
54
55private:
56 std::string filename;
57 FILE * file;
58
59 std::string mode;
60 std::string bufferMode;
61 int64_t bufferSize;
62};
63} // namespace cppfs
64} // namespace filesystem
65} // namespace eve
float size
Definition TreeMesh.cpp:156
A File interface, providing generic means of reading from and writing to files.
Definition File.h:14
virtual FileData * read(int64_t size=ALL)
Reads data from the file and allocates a Data object.
Definition File.cpp:9
virtual bool write(const void *data, int64_t size)=0
Writes data into the File.
File which is created when a user drags and drops an actual file onto the eve game....
Definition File.h:16
int64_t read(void *dst, int64_t size) override
Reads read.
Definition File.cpp:100
bool write(const void *data, int64_t size) override
Writes write.
Definition File.cpp:110
int64_t getSize() override
Byte length of the owned buffer.
Definition File.cpp:67
bool seek(uint64_t pos) override
Seeks seek.
Definition File.cpp:138
bool setBuffer(std::string bufmode, int64_t size) override
Sets the buffer.
Definition File.cpp:148
virtual ~File()
Releases File resources.
Definition File.cpp:22
bool open(std::string newmode) override
Opens open.
Definition File.cpp:26
bool isOpen() const override
True when open.
Definition File.cpp:65
bool close() override
Closes close.
Definition File.cpp:56
int64_t tell() override
Returns the current tell.
Definition File.cpp:128
bool flush() override
Flushes flush.
Definition File.cpp:120
bool isEOF() override
True when eof.
Definition File.cpp:126
std::string getMode() const override
Returns the mode.
Definition File.cpp:180
std::string getFilename() const override
Full filename including extension.
Definition File.cpp:179
std::string getBuffer(int64_t &size) const override
Returns the buffer.
Definition File.cpp:174
Build metadata (engine git commit, build time, third-party version).
Definition Build.cpp:16