载入中...
搜索中...
未找到
eve::filesystem::physfs::File类 参考

#include <File.h>

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

Public 成员函数

 File (std::string filename)
 Constructs an File with the given ilename.
 
virtual ~File ()
 Destructor.
 
bool open (std::string mode) 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.h16 行定义.

构造及析构函数说明

◆ File()

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

Constructs an File with the given ilename.

参数
filenameThe relative filepath of the file to load.

在文件 File.cpp21 行定义.

◆ ~File()

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

Destructor.

重载 eve::filesystem::File .

在文件 File.cpp24 行定义.

引用了 close().

成员函数说明

◆ close()

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

Closes the file.

返回
True if successful, false otherwise.

实现了 eve::filesystem::File.

在文件 File.cpp77 行定义.

被这些函数引用 getSize() , 以及 ~File().

◆ flush()

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

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

实现了 eve::filesystem::File.

在文件 File.cpp137 行定义.

被这些函数引用 write().

◆ getBuffer()

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

实现了 eve::filesystem::File.

在文件 File.cpp190 行定义.

◆ getFilename()

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

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

返回
The filename for this File.

实现了 eve::filesystem::File.

在文件 File.cpp195 行定义.

◆ getMode()

std::string eve::filesystem::physfs::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.cpp197 行定义.

◆ getSize()

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

Gets the size of the file.

返回
The size of the file.

实现了 eve::filesystem::File.

在文件 File.cpp88 行定义.

引用了 close() , 以及 open().

◆ isEOF()

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

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

返回
True if EOF, false otherwise.

实现了 eve::filesystem::File.

在文件 File.cpp153 行定义.

引用了 eve::filesystem::physfs::test_eof().

◆ isOpen()

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

Gets whether the file is open.

实现了 eve::filesystem::File.

在文件 File.cpp86 行定义.

被这些函数引用 setBuffer().

◆ open()

bool eve::filesystem::physfs::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.cpp28 行定义.

引用了 setBuffer().

被这些函数引用 getSize().

◆ read()

int64_t eve::filesystem::physfs::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.cpp101 行定义.

引用了 eve::filesystem::File::ALL.

◆ seek()

bool eve::filesystem::physfs::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.cpp161 行定义.

引用了 pos.

◆ setBuffer()

bool eve::filesystem::physfs::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.cpp163 行定义.

引用了 isOpen().

被这些函数引用 open().

◆ tell()

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

Gets the current position in the File.

返回
The current byte position in the File.

实现了 eve::filesystem::File.

在文件 File.cpp155 行定义.

◆ write()

bool eve::filesystem::physfs::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.cpp118 行定义.

引用了 data , 以及 flush().


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