#include <Filesystem.h>
类 | |
| struct | Info |
Public 成员函数 | |
| Module_REG (Filesystem) | |
| Filesystem () | |
| virtual | ~Filesystem () |
| virtual void | init (const char *arg0)=0 |
| virtual void | setFused (bool fused)=0 |
| virtual bool | isFused () const =0 |
| virtual bool | setupWriteDirectory ()=0 |
| This sets up the save directory. If the it is already set up, nothing happens. | |
| 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 bool | setIdentity (std::string ident, bool appendToPath=false)=0 |
| Sets the name of the save folder. | |
| virtual std::string | getIdentity () const =0 |
| virtual bool | setSource (std::string source)=0 |
| Sets the path to the game source. This can only be set once. | |
| virtual bool | setSourceFromMemory (const void *data, size_t size)=0 |
| 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. | |
| virtual std::string | getSource () const =0 |
| Gets the path to the game source. Returns a 0-length string if the source has not been set. | |
| virtual bool | mount (std::string archive, std::string mountpoint, bool appendToPath=false)=0 |
| virtual bool | mount (Data *data, std::string archivename, std::string mountpoint, bool appendToPath=false)=0 |
| virtual bool | mountRealDirectory (std::string realDir, std::string mountpoint, bool appendToPath=false)=0 |
| virtual bool | unmountRealDirectory (std::string realDir)=0 |
| virtual bool | unmount (std::string archive)=0 |
| virtual bool | unmount (Data *data)=0 |
| virtual File * | newFile (std::string filename) const =0 |
| Creates a new file. | |
| virtual FileData * | newFileData (const void *data, std::string filename, size_t size) const |
| Creates a new FileData object. Data will be copied. | |
| virtual std::string | getWorkingDirectory ()=0 |
| Gets the current working directory. | |
| virtual std::string | getUserDirectory ()=0 |
| Gets the user home directory. | |
| virtual std::string | getAppdataDirectory ()=0 |
| Gets the APPDATA directory. On Windows, this is the folder in the APPDATA% enviroment variable. On Linux, this is the user home folder. | |
| virtual std::string | getSaveDirectory ()=0 |
| Gets the full path of the save folder. | |
| virtual std::string | getSourceBaseDirectory () const =0 |
| 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. | |
| virtual std::string | getRealDirectory (std::string filename) const =0 |
| Gets the real directory path containing the file. | |
| virtual bool | getInfo (std::string filepath, Info &info) const =0 |
| Gets information about the item at the specified filepath. Returns false if nothing exists at the path. | |
| virtual bool | createDirectory (std::string dir)=0 |
| Creates a directory. Write dir must be set. | |
| virtual bool | remove (std::string file)=0 |
| Removes a file (or directory). | |
| virtual FileData * | read (std::string filename, int64_t size=File::ALL) const =0 |
| Reads data from a file. | |
| virtual void | write (std::string filename, const void *data, int64_t size) const =0 |
| Write data to a file. | |
| virtual void | append (std::string filename, const void *data, int64_t size) const =0 |
| Append data to a file, creating it if it doesn't exist. | |
| virtual std::vector< std::string > | getDirectoryItems (std::string dir)=0 |
| This "native" method returns a table of all files in a given directory. | |
| virtual void | setSymlinksEnabled (bool enable)=0 |
| Enable or disable symbolic link support in love.filesystem. | |
| virtual bool | areSymlinksEnabled () const =0 |
| Gets whether symbolic link support is enabled. | |
| virtual std::vector< std::string > & | getRequirePath ()=0 |
| virtual std::vector< std::string > & | getCRequirePath ()=0 |
| virtual void | allowMountingForPath (const std::string &path)=0 |
| Allows a full (OS-dependent) path to be used with Filesystem::mount. | |
| 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. | |
| virtual bool | watch (std::string path)=0 |
| 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. | |
| virtual bool | unwatch (std::string path)=0 |
| Stop watching a path previously passed to watch(). | |
| virtual void | unwatchAll ()=0 |
| virtual int | getWatchCount () const =0 |
| virtual std::string | pollWatch ()=0 |
| Pop next watch event kind: "added"|"removed"|"modified"|"movedFrom"|"movedTo". Empty string if queue empty. Path available via getLastWatchPath(). | |
| virtual std::string | getLastWatchPath () const =0 |
| virtual std::string | getLastWatchRealPath () const =0 |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| virtual std::string | getName () const =0 |
详细描述
在文件 Filesystem.h 第 31 行定义.
构造及析构函数说明
◆ Filesystem()
|
inline |
在文件 Filesystem.h 第 42 行定义.
◆ ~Filesystem()
|
inlinevirtual |
被 eve::filesystem::physfs::Filesystem 重载.
在文件 Filesystem.h 第 43 行定义.
成员函数说明
◆ allowMountingForPath()
|
pure virtual |
Allows a full (OS-dependent) path to be used with Filesystem::mount.
◆ append()
|
pure virtual |
Append data to a file, creating it if it doesn't exist.
- 参数
-
filename The name of the file to write to. data The data to append. size The size in bytes of the data to append.
◆ areSymlinksEnabled()
|
pure virtual |
Gets whether symbolic link support is enabled.
◆ createDirectory()
|
pure virtual |
Creates a directory. Write dir must be set.
- 参数
-
dir The directory to create.
◆ getAppdataDirectory()
|
pure virtual |
Gets the APPDATA directory. On Windows, this is the folder in the APPDATA% enviroment variable. On Linux, this is the user home folder.
◆ getCRequirePath()
|
pure virtual |
◆ getDirectoryItems()
|
pure virtual |
This "native" method returns a table of all files in a given directory.
◆ getExecutablePath()
|
virtual |
Gets the full platform-dependent path to the executable.
在文件 Filesystem.cpp 第 112 行定义.
◆ getIdentity()
|
pure virtual |
◆ getInfo()
|
pure virtual |
Gets information about the item at the specified filepath. Returns false if nothing exists at the path.
◆ getLastWatchPath()
|
pure virtual |
◆ getLastWatchRealPath()
|
pure virtual |
◆ getRealDirectory()
|
pure virtual |
Gets the real directory path containing the file.
◆ getRequirePath()
|
pure virtual |
◆ getSaveDirectory()
|
pure virtual |
Gets the full path of the save folder.
◆ getSource()
|
pure virtual |
Gets the path to the game source. Returns a 0-length string if the source has not been set.
◆ getSourceBaseDirectory()
|
pure virtual |
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.
◆ getUserDirectory()
|
pure virtual |
Gets the user home directory.
◆ getWatchCount()
|
pure virtual |
◆ getWorkingDirectory()
|
pure virtual |
Gets the current working directory.
◆ init()
|
pure virtual |
◆ isAndroidSaveExternal()
|
inlinevirtual |
Gets whether the Android save is external. Returns a bool.
在文件 Filesystem.h 第 69 行定义.
◆ isFused()
|
pure virtual |
◆ isRealDirectory()
|
virtual |
Gets whether the given full (OS-dependent) path is a directory.
在文件 Filesystem.cpp 第 96 行定义.
被这些函数引用 eve::filesystem::physfs::Filesystem::mountRealDirectory().
◆ Module_REG()
| eve::filesystem::Filesystem::Module_REG | ( | Filesystem | ) |
◆ mount() [1/2]
|
pure virtual |
◆ mount() [2/2]
|
pure virtual |
◆ mountRealDirectory()
|
pure virtual |
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.
- 参数
-
realDir Absolute OS path to an existing directory. mountpoint Virtual path to mount at ("" = "/"). appendToPath False = highest priority (searched first).
◆ newFile()
|
pure virtual |
Creates a new file.
在 eve::filesystem::physfs::Filesystem 内被实现.
被这些函数引用 eve::model3d::EveFileSystem::open().
◆ newFileData()
|
virtual |
Creates a new FileData object. Data will be copied.
- 参数
-
data Pointer to the data. size The size of the data. filename The full filename used to file type identification.
在文件 Filesystem.cpp 第 88 行定义.
引用了 data, EV_PARAM_CHECK , 以及 eve::filesystem::FileData::getData().
◆ pollWatch()
|
pure virtual |
Pop next watch event kind: "added"|"removed"|"modified"|"movedFrom"|"movedTo". Empty string if queue empty. Path available via getLastWatchPath().
◆ read()
|
pure virtual |
Reads data from a file.
- 参数
-
filename The name of the file to read from. size The size in bytes of the data to read.
在 eve::filesystem::physfs::Filesystem 内被实现.
被这些函数引用 eve::map::loadConfigFile() , 以及 eve::map::loadMapFile().
◆ remove()
|
pure virtual |
Removes a file (or directory).
- 参数
-
file The file or directory to remove.
◆ setAndroidSaveExternal()
|
inlinevirtual |
This sets the save location on Android. False for internal, true for external
- 参数
-
external Bool for whether Android should use external file storage.
在文件 Filesystem.h 第 63 行定义.
◆ setFused()
|
pure virtual |
◆ setIdentity()
|
pure virtual |
Sets the name of the save folder.
- 参数
-
ident The name of the game. Will be used to to create the folder in the LOVE data folder.
◆ setSource()
|
pure virtual |
Sets the path to the game source. This can only be set once.
- 参数
-
source Path to a directory or a .love-file.
◆ setSourceFromMemory()
|
pure virtual |
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.
- 参数
-
data Pointer to the archive bytes. size Number of bytes.
◆ setSymlinksEnabled()
|
pure virtual |
Enable or disable symbolic link support in love.filesystem.
◆ setupWriteDirectory()
|
pure virtual |
This sets up the save directory. If the it is already set up, nothing happens.
- 返回
- True on success, false otherwise.
◆ unmount() [1/2]
|
pure virtual |
◆ unmount() [2/2]
|
pure virtual |
◆ unmountRealDirectory()
|
pure virtual |
Unmounts a directory previously added via mountRealDirectory().
◆ unwatch()
|
pure virtual |
Stop watching a path previously passed to watch().
◆ unwatchAll()
|
pure virtual |
◆ watch()
|
pure virtual |
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::physfs::Filesystem 内被实现.
被这些函数引用 eve::map::loadConfigFile().
◆ write()
|
pure virtual |
Write data to a file.
- 参数
-
filename The name of the file to write to. data The data to write. size The size in bytes of the data to write.
该类的文档由以下文件生成:
- src/modules/filesystem/Filesystem.h
- src/modules/filesystem/Filesystem.cpp
Public 成员函数 继承自