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

PhysFS 文件系统后端实现(挂载/解挂、读写、热重载)。 更多...

#include <Filesystem.h>

类 eve::filesystem::physfs::Filesystem 继承关系图:
eve::filesystem::Filesystem eve::Module

Public 成员函数

 Filesystem ()
 
 ~Filesystem () override
 
void init (const char *arg0) override
 
void setFused (bool fused) override
 
bool isFused () const override
 
bool setupWriteDirectory () override
 This sets up the save directory. If the it is already set up, nothing happens.
 
bool setIdentity (std::string ident, bool appendToPath=false) override
 Sets the name of the save folder.
 
std::string getIdentity () const override
 
bool setSource (std::string source) override
 Sets the path to the game source. This can only be set once.
 
bool setSourceFromMemory (const void *data, size_t size) override
 Loads the game source from a packaged archive (.eve / zip) held entirely in memory and mounts it at "/" (no extraction to disk). The bytes are copied and kept alive for the lifetime of the mounted archive. This can only be set once.
 
std::string getSource () const override
 Gets the path to the game source. Returns a 0-length string if the source has not been set.
 
bool mount (std::string archive, std::string mountpoint, bool appendToPath=false) override
 
bool mount (Data *data, std::string archivename, std::string mountpoint, bool appendToPath=false) override
 
bool mountRealDirectory (std::string realDir, std::string mountpoint, bool appendToPath=false) override
 
bool unmountRealDirectory (std::string realDir) override
 
bool unmount (std::string archive) override
 
bool unmount (Data *data) override
 
filesystem::FilenewFile (std::string filename) const override
 Creates a new file.
 
std::string getWorkingDirectory () override
 Gets the current working directory.
 
std::string getUserDirectory () override
 Gets the user home directory.
 
std::string getAppdataDirectory () override
 Gets the APPDATA directory. On Windows, this is the folder in the APPDATA% enviroment variable. On Linux, this is the user home folder.
 
std::string getSaveDirectory () override
 Gets the full path of the save folder.
 
std::string getSourceBaseDirectory () const override
 Gets the full path to the directory containing the game source. For example if the game source is C:\Games\mygame.love, this will return C:\Games.
 
std::string getRealDirectory (std::string filename) const override
 Gets the real directory path containing the file.
 
bool getInfo (std::string filepath, Info &info) const override
 Gets information about the item at the specified filepath. Returns false if nothing exists at the path.
 
bool createDirectory (std::string dir) override
 Creates a directory. Write dir must be set.
 
bool remove (std::string file) override
 Removes a file (or directory).
 
FileDataread (std::string filename, int64_t size=File::ALL) const override
 Reads data from a file.
 
void write (std::string filename, const void *data, int64_t size) const override
 Write data to a file.
 
void append (std::string filename, const void *data, int64_t size) const override
 Append data to a file, creating it if it doesn't exist.
 
std::vector< std::string > getDirectoryItems (std::string dir) override
 This "native" method returns a table of all files in a given directory.
 
void setSymlinksEnabled (bool enable) override
 Enable or disable symbolic link support in love.filesystem.
 
bool areSymlinksEnabled () const override
 Gets whether symbolic link support is enabled.
 
std::vector< std::string > & getRequirePath () override
 
std::vector< std::string > & getCRequirePath () override
 
void allowMountingForPath (const std::string &path) override
 Allows a full (OS-dependent) path to be used with Filesystem::mount.
 
bool watch (std::string path) override
 Watch a virtual or absolute OS path (file or directory). File watches monitor the parent directory and filter by basename. Returns false if the path cannot be resolved to a real directory.
 
bool unwatch (std::string path) override
 Stop watching a path previously passed to watch().
 
void unwatchAll () override
 
int getWatchCount () const override
 
std::string pollWatch () override
 Pop next watch event kind: "added"|"removed"|"modified"|"movedFrom"|"movedTo". Empty string if queue empty. Path available via getLastWatchPath().
 
std::string getLastWatchPath () const override
 
std::string getLastWatchRealPath () const override
 
- Public 成员函数 继承自 eve::filesystem::Filesystem
 Module_REG (Filesystem)
 
 Filesystem ()
 
virtual void setAndroidSaveExternal (bool useExternal=false)
 This sets the save location on Android. False for internal, true for external
 
virtual bool isAndroidSaveExternal () const
 Gets whether the Android save is external. Returns a bool.
 
virtual FileDatanewFileData (const void *data, std::string filename, size_t size) const
 Creates a new FileData object. Data will be copied.
 
virtual bool isRealDirectory (const std::string &path) const
 Gets whether the given full (OS-dependent) path is a directory.
 
virtual std::string getExecutablePath () const
 Gets the full platform-dependent path to the executable.
 
- Public 成员函数 继承自 eve::Module
virtual ~Module ()
 
virtual std::string getName () const =0
 

详细描述

PhysFS 文件系统后端实现(挂载/解挂、读写、热重载)。

在文件 Filesystem.h19 行定义.

构造及析构函数说明

◆ Filesystem()

eve::filesystem::physfs::Filesystem::Filesystem ( )

在文件 Filesystem.cpp76 行定义.

引用了 c, getModInst , 以及 init().

◆ ~Filesystem()

eve::filesystem::physfs::Filesystem::~Filesystem ( )
overridevirtual

重载 eve::filesystem::Filesystem .

在文件 Filesystem.cpp89 行定义.

引用了 unwatchAll().

成员函数说明

◆ allowMountingForPath()

void eve::filesystem::physfs::Filesystem::allowMountingForPath ( const std::string &  path)
overridevirtual

Allows a full (OS-dependent) path to be used with Filesystem::mount.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp638 行定义.

◆ append()

void eve::filesystem::physfs::Filesystem::append ( std::string  filename,
const void *  data,
int64_t  size 
) const
overridevirtual

Append data to a file, creating it if it doesn't exist.

参数
filenameThe name of the file to write to.
dataThe data to append.
sizeThe size in bytes of the data to append.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp599 行定义.

引用了 data , 以及 file.

◆ areSymlinksEnabled()

bool eve::filesystem::physfs::Filesystem::areSymlinksEnabled ( ) const
overridevirtual

Gets whether symbolic link support is enabled.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp628 行定义.

◆ createDirectory()

bool eve::filesystem::physfs::Filesystem::createDirectory ( std::string  dir)
overridevirtual

Creates a directory. Write dir must be set.

参数
dirThe directory to create.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp561 行定义.

引用了 dir , 以及 setupWriteDirectory().

被这些函数引用 setupWriteDirectory().

◆ getAppdataDirectory()

std::string eve::filesystem::physfs::Filesystem::getAppdataDirectory ( )
overridevirtual

Gets the APPDATA directory. On Windows, this is the folder in the APPDATA% enviroment variable. On Linux, this is the user home folder.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp477 行定义.

引用了 getUserDirectory().

被这些函数引用 setIdentity().

◆ getCRequirePath()

std::vector< std::string > & eve::filesystem::physfs::Filesystem::getCRequirePath ( )
overridevirtual

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp636 行定义.

◆ getDirectoryItems()

std::vector< std::string > eve::filesystem::physfs::Filesystem::getDirectoryItems ( std::string  dir)
overridevirtual

This "native" method returns a table of all files in a given directory.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp608 行定义.

引用了 dir.

◆ getIdentity()

std::string eve::filesystem::physfs::Filesystem::getIdentity ( ) const
overridevirtual

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp181 行定义.

◆ getInfo()

bool eve::filesystem::physfs::Filesystem::getInfo ( std::string  filepath,
Info info 
) const
overridevirtual

Gets information about the item at the specified filepath. Returns false if nothing exists at the path.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp540 行定义.

引用了 eve::filesystem::Filesystem::Info::modtime, eve::filesystem::Filesystem::Info::size , 以及 eve::filesystem::Filesystem::Info::type.

◆ getLastWatchPath()

std::string eve::filesystem::physfs::Filesystem::getLastWatchPath ( ) const
overridevirtual

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp794 行定义.

◆ getLastWatchRealPath()

std::string eve::filesystem::physfs::Filesystem::getLastWatchRealPath ( ) const
overridevirtual

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp795 行定义.

◆ getRealDirectory()

std::string eve::filesystem::physfs::Filesystem::getRealDirectory ( std::string  filename) const
overridevirtual

Gets the real directory path containing the file.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp530 行定义.

引用了 dir.

◆ getRequirePath()

std::vector< std::string > & eve::filesystem::physfs::Filesystem::getRequirePath ( )
overridevirtual

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp634 行定义.

◆ getSaveDirectory()

std::string eve::filesystem::physfs::Filesystem::getSaveDirectory ( )
overridevirtual

Gets the full path of the save folder.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp506 行定义.

◆ getSource()

std::string eve::filesystem::physfs::Filesystem::getSource ( ) const
overridevirtual

Gets the path to the game source. Returns a 0-length string if the source has not been set.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp244 行定义.

◆ getSourceBaseDirectory()

std::string eve::filesystem::physfs::Filesystem::getSourceBaseDirectory ( ) const
overridevirtual

Gets the full path to the directory containing the game source. For example if the game source is C:\Games\mygame.love, this will return C:\Games.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp508 行定义.

被这些函数引用 mount() , 以及 unmount().

◆ getUserDirectory()

std::string eve::filesystem::physfs::Filesystem::getUserDirectory ( )
overridevirtual

Gets the user home directory.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp463 行定义.

引用了 dir.

被这些函数引用 getAppdataDirectory() , 以及 setupWriteDirectory().

◆ getWatchCount()

int eve::filesystem::physfs::Filesystem::getWatchCount ( ) const
overridevirtual

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp776 行定义.

◆ getWorkingDirectory()

std::string eve::filesystem::physfs::Filesystem::getWorkingDirectory ( )
overridevirtual

Gets the current working directory.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp442 行定义.

引用了 EVENGINE_MAX_PATH.

◆ init()

void eve::filesystem::physfs::Filesystem::init ( const char *  arg0)
overridevirtual

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp104 行定义.

引用了 setSymlinksEnabled().

被这些函数引用 Filesystem().

◆ isFused()

bool eve::filesystem::physfs::Filesystem::isFused ( ) const
overridevirtual

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp118 行定义.

被这些函数引用 mount() , 以及 unmount().

◆ mount() [1/2]

bool eve::filesystem::physfs::Filesystem::mount ( Data data,
std::string  archivename,
std::string  mountpoint,
bool  appendToPath = false 
)
overridevirtual

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp354 行定义.

引用了 data.

◆ mount() [2/2]

bool eve::filesystem::physfs::Filesystem::mount ( std::string  archive,
std::string  mountpoint,
bool  appendToPath = false 
)
overridevirtual

◆ mountRealDirectory()

bool eve::filesystem::physfs::Filesystem::mountRealDirectory ( std::string  realDir,
std::string  mountpoint,
bool  appendToPath = false 
)
overridevirtual

Mounts a real (OS-level) directory at a virtual mountpoint, bypassing the safety checks in mount(). Used by hot reload to overlay a writable sync directory in front of a read-only bundled/packaged game source.

参数
realDirAbsolute OS path to an existing directory.
mountpointVirtual path to mount at ("" = "/").
appendToPathFalse = highest priority (searched first).

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp365 行定义.

引用了 eve::filesystem::Filesystem::isRealDirectory().

◆ newFile()

filesystem::File * eve::filesystem::physfs::Filesystem::newFile ( std::string  filename) const
overridevirtual

Creates a new file.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp440 行定义.

◆ pollWatch()

std::string eve::filesystem::physfs::Filesystem::pollWatch ( )
overridevirtual

Pop next watch event kind: "added"|"removed"|"modified"|"movedFrom"|"movedTo". Empty string if queue empty. Path available via getLastWatchPath().

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp781 行定义.

引用了 eve::filesystem::FileWatch::Event::kind, eve::filesystem::FileWatch::Event::path , 以及 eve::filesystem::FileWatch::Event::realPath.

◆ read()

FileData * eve::filesystem::physfs::Filesystem::read ( std::string  filename,
int64_t  size = File::ALL 
) const
overridevirtual

Reads data from a file.

参数
filenameThe name of the file to read from.
sizeThe size in bytes of the data to read.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp581 行定义.

引用了 file.

◆ remove()

bool eve::filesystem::physfs::Filesystem::remove ( std::string  file)
overridevirtual

Removes a file (or directory).

参数
fileThe file or directory to remove.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp571 行定义.

引用了 file , 以及 setupWriteDirectory().

◆ setFused()

void eve::filesystem::physfs::Filesystem::setFused ( bool  fused)
overridevirtual

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp112 行定义.

◆ setIdentity()

bool eve::filesystem::physfs::Filesystem::setIdentity ( std::string  ident,
bool  appendToPath = false 
)
overridevirtual

Sets the name of the save folder.

参数
identThe name of the game. Will be used to to create the folder in the LOVE data folder.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp123 行定义.

引用了 EVENGINE_APPDATA_FOLDER, EVENGINE_APPDATA_PREFIX, EVENGINE_PATH_SEPARATOR, getAppdataDirectory() , 以及 eve::filesystem::Filesystem::isAndroidSaveExternal().

◆ setSource()

bool eve::filesystem::physfs::Filesystem::setSource ( std::string  source)
overridevirtual

Sets the path to the game source. This can only be set once.

参数
sourcePath to a directory or a .love-file.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp183 行定义.

◆ setSourceFromMemory()

bool eve::filesystem::physfs::Filesystem::setSourceFromMemory ( const void *  data,
size_t  size 
)
overridevirtual

Loads the game source from a packaged archive (.eve / zip) held entirely in memory and mounts it at "/" (no extraction to disk). The bytes are copied and kept alive for the lifetime of the mounted archive. This can only be set once.

参数
dataPointer to the archive bytes.
sizeNumber of bytes.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp246 行定义.

引用了 data.

◆ setSymlinksEnabled()

void eve::filesystem::physfs::Filesystem::setSymlinksEnabled ( bool  enable)
overridevirtual

Enable or disable symbolic link support in love.filesystem.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp622 行定义.

被这些函数引用 init().

◆ setupWriteDirectory()

bool eve::filesystem::physfs::Filesystem::setupWriteDirectory ( )
overridevirtual

This sets up the save directory. If the it is already set up, nothing happens.

返回
True on success, false otherwise.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp270 行定义.

引用了 createDirectory() , 以及 getUserDirectory().

被这些函数引用 createDirectory() , 以及 remove().

◆ unmount() [1/2]

bool eve::filesystem::physfs::Filesystem::unmount ( Data data)
overridevirtual

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp429 行定义.

引用了 data , 以及 unmount().

◆ unmount() [2/2]

bool eve::filesystem::physfs::Filesystem::unmount ( std::string  archive)
overridevirtual

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp389 行定义.

引用了 EVENGINE_PATH_SEPARATOR, getSourceBaseDirectory() , 以及 isFused().

被这些函数引用 unmount().

◆ unmountRealDirectory()

bool eve::filesystem::physfs::Filesystem::unmountRealDirectory ( std::string  realDir)
overridevirtual

Unmounts a directory previously added via mountRealDirectory().

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp380 行定义.

引用了 ok.

◆ unwatch()

bool eve::filesystem::physfs::Filesystem::unwatch ( std::string  path)
overridevirtual

Stop watching a path previously passed to watch().

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp770 行定义.

引用了 eve::filesystem::FileWatch::remove().

◆ unwatchAll()

void eve::filesystem::physfs::Filesystem::unwatchAll ( )
overridevirtual

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp772 行定义.

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

◆ watch()

bool eve::filesystem::physfs::Filesystem::watch ( std::string  path)
overridevirtual

Watch a virtual or absolute OS path (file or directory). File watches monitor the parent directory and filter by basename. Returns false if the path cannot be resolved to a real directory.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp764 行定义.

引用了 eve::filesystem::FileWatch::add() , 以及 filter.

◆ write()

void eve::filesystem::physfs::Filesystem::write ( std::string  filename,
const void *  data,
int64_t  size 
) const
overridevirtual

Write data to a file.

参数
filenameThe name of the file to write to.
dataThe data to write.
sizeThe size in bytes of the data to write.

实现了 eve::filesystem::Filesystem.

在文件 Filesystem.cpp590 行定义.

引用了 data , 以及 file.


该类的文档由以下文件生成: