File which is created when a user drags and drops an actual file onto the eve game. Uses C++ stdio & filesystem. Filenames are system-dependent full paths. 更多...
#include <File.h>
Public 成员函数 | |
| File (std::string filename) | |
| virtual | ~File () |
| Destructor. | |
| bool | open (std::string newmode) override |
| Opens the file in a certain mode. | |
| bool | close () override |
| Closes the file. | |
| bool | isOpen () const override |
| Gets whether the file is open. | |
| int64_t | getSize () override |
| Gets the size of the file. | |
| int64_t | read (void *dst, int64_t size) override |
| Reads data into the destination buffer. | |
| bool | write (const void *data, int64_t size) override |
| Writes data into the File. | |
| bool | flush () override |
| Flushes the currently buffered file data to disk. Only applicable in write mode. | |
| bool | isEOF () override |
| Checks whether we are currently at end-of-file. | |
| int64_t | tell () override |
| Gets the current position in the File. | |
| bool | seek (uint64_t pos) override |
| Seeks to a certain position in the File. | |
| bool | setBuffer (std::string bufmode, int64_t size) override |
| Sets the buffering mode for the file. When buffering is enabled, | |
| std::string | getBuffer (int64_t &size) const override |
| std::string | getMode () const override |
| Gets the current mode of the File. | |
| std::string | getFilename () const override |
| Gets the filename for this File, or empty string if none. | |
Public 成员函数 继承自 eve::filesystem::File | |
| virtual FileData * | read (int64_t size=ALL) |
| Reads data from the file and allocates a Data object. | |
| virtual bool | write (const Data *data, int64_t size=ALL) |
| Writes a Data object into the File. | |
| virtual std::string | getExtension () const |
| Gets the file extension for this File, or empty string if none. | |
额外继承的成员函数 | |
静态 Public 属性 继承自 eve::filesystem::File | |
| static const int64_t | ALL = -1 |
| Used to indicate ALL data in a file. | |
详细描述
File which is created when a user drags and drops an actual file onto the eve game. Uses C++ stdio & filesystem. Filenames are system-dependent full paths.
构造及析构函数说明
◆ File()
◆ ~File()
|
virtual |
成员函数说明
◆ close()
|
overridevirtual |
◆ flush()
|
overridevirtual |
Flushes the currently buffered file data to disk. Only applicable in write mode.
引用了 file.
◆ getBuffer()
|
overridevirtual |
- 参数
-
[out] size The size in bytes of the buffer.
- 返回
- The current buffer mode.
◆ getFilename()
|
overridevirtual |
◆ getMode()
|
overridevirtual |
◆ getSize()
|
overridevirtual |
◆ isEOF()
|
overridevirtual |
◆ isOpen()
|
overridevirtual |
Gets whether the file is open.
被这些函数引用 setBuffer().
◆ open()
|
overridevirtual |
Opens the file in a certain mode.
- 参数
-
mode read(r), write(w), append(a).
- 返回
- True if successful, false otherwise.
引用了 setBuffer().
◆ read()
|
overridevirtual |
◆ seek()
|
overridevirtual |
◆ setBuffer()
|
overridevirtual |
Sets the buffering mode for the file. When buffering is enabled,
'none' - no buffer enabled 'full' - the file will not write to disk (or will pre-load data if in read mode) until the buffer's capacity is reached. 'newline' - the file will not only write when capacity is reached, but also write to disk if a newline is written.
- 参数
-
bufmode The buffer mode. size The size in bytes of the buffer.
被这些函数引用 open().
◆ tell()
|
overridevirtual |
◆ write()
|
overridevirtual |
该类的文档由以下文件生成:
Public 成员函数 继承自