载入中...
搜索中...
未找到
eve::filesystem::cppfs::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. 更多...

#include <File.h>

类 eve::filesystem::cppfs::File 继承关系图:
eve::filesystem::File

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 FileDataread (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.h16 行定义.

构造及析构函数说明

◆ File()

eve::filesystem::cppfs::File::File ( std::string  filename)

在文件 File.cpp20 行定义.

◆ ~File()

eve::filesystem::cppfs::File::~File ( )
virtual

Destructor.

重载 eve::filesystem::File .

在文件 File.cpp22 行定义.

引用了 close().

成员函数说明

◆ close()

bool eve::filesystem::cppfs::File::close ( )
overridevirtual

Closes the file.

返回
True if successful, false otherwise.

实现了 eve::filesystem::File.

在文件 File.cpp56 行定义.

被这些函数引用 ~File().

◆ flush()

bool eve::filesystem::cppfs::File::flush ( )
overridevirtual

Flushes the currently buffered file data to disk. Only applicable in write mode.

实现了 eve::filesystem::File.

在文件 File.cpp120 行定义.

引用了 file.

◆ getBuffer()

std::string eve::filesystem::cppfs::File::getBuffer ( int64_t &  size) const
overridevirtual
参数
[out]sizeThe size in bytes of the buffer.
返回
The current buffer mode.

实现了 eve::filesystem::File.

在文件 File.cpp174 行定义.

◆ getFilename()

std::string eve::filesystem::cppfs::File::getFilename ( ) const
overridevirtual

Gets the filename for this File, or empty string if none.

返回
The filename for this File.

实现了 eve::filesystem::File.

在文件 File.cpp179 行定义.

◆ getMode()

std::string eve::filesystem::cppfs::File::getMode ( ) const
overridevirtual

Gets the current mode of the File.

返回
The current mode of the File; CLOSED, READ, WRITE or APPEND.

实现了 eve::filesystem::File.

在文件 File.cpp180 行定义.

◆ getSize()

int64_t eve::filesystem::cppfs::File::getSize ( )
overridevirtual

Gets the size of the file.

返回
The size of the file.

实现了 eve::filesystem::File.

在文件 File.cpp67 行定义.

被这些函数引用 isEOF().

◆ isEOF()

bool eve::filesystem::cppfs::File::isEOF ( )
overridevirtual

Checks whether we are currently at end-of-file.

返回
True if EOF, false otherwise.

实现了 eve::filesystem::File.

在文件 File.cpp126 行定义.

引用了 file, getSize() , 以及 tell().

◆ isOpen()

bool eve::filesystem::cppfs::File::isOpen ( ) const
overridevirtual

Gets whether the file is open.

实现了 eve::filesystem::File.

在文件 File.cpp65 行定义.

被这些函数引用 setBuffer().

◆ open()

bool eve::filesystem::cppfs::File::open ( std::string  mode)
overridevirtual

Opens the file in a certain mode.

参数
moderead(r), write(w), append(a).
返回
True if successful, false otherwise.

实现了 eve::filesystem::File.

在文件 File.cpp26 行定义.

引用了 setBuffer().

◆ read()

int64_t eve::filesystem::cppfs::File::read ( void *  dst,
int64_t  size 
)
overridevirtual

Reads data into the destination buffer.

参数
dstThe destination buffer.
sizeThe number of bytes to attempt reading.
返回
The number of bytes actually read.

实现了 eve::filesystem::File.

在文件 File.cpp100 行定义.

引用了 file , 以及 read().

被这些函数引用 read().

◆ seek()

bool eve::filesystem::cppfs::File::seek ( uint64_t  pos)
overridevirtual

Seeks to a certain position in the File.

参数
posThe byte position in the file.
返回
True on success, false otherwise.

实现了 eve::filesystem::File.

在文件 File.cpp138 行定义.

引用了 file , 以及 pos.

◆ setBuffer()

bool eve::filesystem::cppfs::File::setBuffer ( std::string  bufmode,
int64_t  size 
)
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.

参数
bufmodeThe buffer mode.
sizeThe size in bytes of the buffer.

实现了 eve::filesystem::File.

在文件 File.cpp148 行定义.

引用了 file , 以及 isOpen().

被这些函数引用 open().

◆ tell()

int64_t eve::filesystem::cppfs::File::tell ( )
overridevirtual

Gets the current position in the File.

返回
The current byte position in the File.

实现了 eve::filesystem::File.

在文件 File.cpp128 行定义.

引用了 file.

被这些函数引用 isEOF().

◆ write()

bool eve::filesystem::cppfs::File::write ( const void *  data,
int64_t  size 
)
overridevirtual

Writes data into the File.

参数
dataThe source buffer.
sizeThe size of the buffer.
返回
True of success, false otherwise.

实现了 eve::filesystem::File.

在文件 File.cpp110 行定义.

引用了 data , 以及 file.


该类的文档由以下文件生成:
  • src/modules/filesystem/cppfs/File.h
  • src/modules/filesystem/cppfs/File.cpp