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

#include <Filesystem.h>

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

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 FilenewFile (std::string filename) const =0
 Creates a new file.
 
virtual FileDatanewFileData (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 FileDataread (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.h31 行定义.

构造及析构函数说明

◆ Filesystem()

eve::filesystem::Filesystem::Filesystem ( )
inline

在文件 Filesystem.h42 行定义.

◆ ~Filesystem()

virtual eve::filesystem::Filesystem::~Filesystem ( )
inlinevirtual

eve::filesystem::physfs::Filesystem 重载.

在文件 Filesystem.h43 行定义.

成员函数说明

◆ allowMountingForPath()

virtual void eve::filesystem::Filesystem::allowMountingForPath ( const std::string &  path)
pure virtual

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

eve::filesystem::physfs::Filesystem 内被实现.

◆ append()

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

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::physfs::Filesystem 内被实现.

◆ areSymlinksEnabled()

virtual bool eve::filesystem::Filesystem::areSymlinksEnabled ( ) const
pure virtual

Gets whether symbolic link support is enabled.

eve::filesystem::physfs::Filesystem 内被实现.

◆ createDirectory()

virtual bool eve::filesystem::Filesystem::createDirectory ( std::string  dir)
pure virtual

Creates a directory. Write dir must be set.

参数
dirThe directory to create.

eve::filesystem::physfs::Filesystem 内被实现.

◆ getAppdataDirectory()

virtual std::string eve::filesystem::Filesystem::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.

eve::filesystem::physfs::Filesystem 内被实现.

◆ getCRequirePath()

virtual std::vector< std::string > & eve::filesystem::Filesystem::getCRequirePath ( )
pure virtual

◆ getDirectoryItems()

virtual std::vector< std::string > eve::filesystem::Filesystem::getDirectoryItems ( std::string  dir)
pure virtual

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

eve::filesystem::physfs::Filesystem 内被实现.

◆ getExecutablePath()

std::string eve::filesystem::Filesystem::getExecutablePath ( ) const
virtual

Gets the full platform-dependent path to the executable.

在文件 Filesystem.cpp112 行定义.

◆ getIdentity()

virtual std::string eve::filesystem::Filesystem::getIdentity ( ) const
pure virtual

◆ getInfo()

virtual bool eve::filesystem::Filesystem::getInfo ( std::string  filepath,
Info info 
) const
pure virtual

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

eve::filesystem::physfs::Filesystem 内被实现.

被这些函数引用 eve::model3d::EveFileSystem::exists().

◆ getLastWatchPath()

virtual std::string eve::filesystem::Filesystem::getLastWatchPath ( ) const
pure virtual

◆ getLastWatchRealPath()

virtual std::string eve::filesystem::Filesystem::getLastWatchRealPath ( ) const
pure virtual

◆ getRealDirectory()

virtual std::string eve::filesystem::Filesystem::getRealDirectory ( std::string  filename) const
pure virtual

Gets the real directory path containing the file.

eve::filesystem::physfs::Filesystem 内被实现.

◆ getRequirePath()

virtual std::vector< std::string > & eve::filesystem::Filesystem::getRequirePath ( )
pure virtual

◆ getSaveDirectory()

virtual std::string eve::filesystem::Filesystem::getSaveDirectory ( )
pure virtual

Gets the full path of the save folder.

eve::filesystem::physfs::Filesystem 内被实现.

◆ getSource()

virtual std::string eve::filesystem::Filesystem::getSource ( ) const
pure virtual

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

eve::filesystem::physfs::Filesystem 内被实现.

◆ getSourceBaseDirectory()

virtual std::string eve::filesystem::Filesystem::getSourceBaseDirectory ( ) const
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.

eve::filesystem::physfs::Filesystem 内被实现.

◆ getUserDirectory()

virtual std::string eve::filesystem::Filesystem::getUserDirectory ( )
pure virtual

Gets the user home directory.

eve::filesystem::physfs::Filesystem 内被实现.

◆ getWatchCount()

virtual int eve::filesystem::Filesystem::getWatchCount ( ) const
pure virtual

◆ getWorkingDirectory()

virtual std::string eve::filesystem::Filesystem::getWorkingDirectory ( )
pure virtual

Gets the current working directory.

eve::filesystem::physfs::Filesystem 内被实现.

◆ init()

virtual void eve::filesystem::Filesystem::init ( const char *  arg0)
pure virtual

◆ isAndroidSaveExternal()

virtual bool eve::filesystem::Filesystem::isAndroidSaveExternal ( ) const
inlinevirtual

Gets whether the Android save is external. Returns a bool.

在文件 Filesystem.h69 行定义.

被这些函数引用 eve::filesystem::physfs::Filesystem::setIdentity().

◆ isFused()

virtual bool eve::filesystem::Filesystem::isFused ( ) const
pure virtual

◆ isRealDirectory()

bool eve::filesystem::Filesystem::isRealDirectory ( const std::string &  path) const
virtual

Gets whether the given full (OS-dependent) path is a directory.

在文件 Filesystem.cpp96 行定义.

被这些函数引用 eve::filesystem::physfs::Filesystem::mountRealDirectory().

◆ Module_REG()

eve::filesystem::Filesystem::Module_REG ( Filesystem  )

◆ mount() [1/2]

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

◆ mount() [2/2]

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

◆ mountRealDirectory()

virtual bool eve::filesystem::Filesystem::mountRealDirectory ( std::string  realDir,
std::string  mountpoint,
bool  appendToPath = false 
)
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.

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

eve::filesystem::physfs::Filesystem 内被实现.

◆ newFile()

virtual File * eve::filesystem::Filesystem::newFile ( std::string  filename) const
pure virtual

Creates a new file.

eve::filesystem::physfs::Filesystem 内被实现.

被这些函数引用 eve::model3d::EveFileSystem::open().

◆ newFileData()

FileData * eve::filesystem::Filesystem::newFileData ( const void *  data,
std::string  filename,
size_t  size 
) const
virtual

Creates a new FileData object. Data will be copied.

参数
dataPointer to the data.
sizeThe size of the data.
filenameThe full filename used to file type identification.

在文件 Filesystem.cpp88 行定义.

引用了 data, EV_PARAM_CHECK , 以及 eve::filesystem::FileData::getData().

◆ pollWatch()

virtual std::string eve::filesystem::Filesystem::pollWatch ( )
pure virtual

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

eve::filesystem::physfs::Filesystem 内被实现.

◆ read()

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

Reads data from a file.

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

eve::filesystem::physfs::Filesystem 内被实现.

被这些函数引用 eve::map::loadConfigFile() , 以及 eve::map::loadMapFile().

◆ remove()

virtual bool eve::filesystem::Filesystem::remove ( std::string  file)
pure virtual

Removes a file (or directory).

参数
fileThe file or directory to remove.

eve::filesystem::physfs::Filesystem 内被实现.

◆ setAndroidSaveExternal()

virtual void eve::filesystem::Filesystem::setAndroidSaveExternal ( bool  useExternal = false)
inlinevirtual

This sets the save location on Android. False for internal, true for external

参数
externalBool for whether Android should use external file storage.

在文件 Filesystem.h63 行定义.

◆ setFused()

virtual void eve::filesystem::Filesystem::setFused ( bool  fused)
pure virtual

◆ setIdentity()

virtual bool eve::filesystem::Filesystem::setIdentity ( std::string  ident,
bool  appendToPath = false 
)
pure virtual

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::physfs::Filesystem 内被实现.

◆ setSource()

virtual bool eve::filesystem::Filesystem::setSource ( std::string  source)
pure virtual

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

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

eve::filesystem::physfs::Filesystem 内被实现.

◆ setSourceFromMemory()

virtual bool eve::filesystem::Filesystem::setSourceFromMemory ( const void *  data,
size_t  size 
)
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.

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

eve::filesystem::physfs::Filesystem 内被实现.

◆ setSymlinksEnabled()

virtual void eve::filesystem::Filesystem::setSymlinksEnabled ( bool  enable)
pure virtual

Enable or disable symbolic link support in love.filesystem.

eve::filesystem::physfs::Filesystem 内被实现.

◆ setupWriteDirectory()

virtual bool eve::filesystem::Filesystem::setupWriteDirectory ( )
pure virtual

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

返回
True on success, false otherwise.

eve::filesystem::physfs::Filesystem 内被实现.

◆ unmount() [1/2]

virtual bool eve::filesystem::Filesystem::unmount ( Data data)
pure virtual

◆ unmount() [2/2]

virtual bool eve::filesystem::Filesystem::unmount ( std::string  archive)
pure virtual

◆ unmountRealDirectory()

virtual bool eve::filesystem::Filesystem::unmountRealDirectory ( std::string  realDir)
pure virtual

Unmounts a directory previously added via mountRealDirectory().

eve::filesystem::physfs::Filesystem 内被实现.

◆ unwatch()

virtual bool eve::filesystem::Filesystem::unwatch ( std::string  path)
pure virtual

Stop watching a path previously passed to watch().

eve::filesystem::physfs::Filesystem 内被实现.

◆ unwatchAll()

virtual void eve::filesystem::Filesystem::unwatchAll ( )
pure virtual

◆ watch()

virtual bool eve::filesystem::Filesystem::watch ( std::string  path)
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()

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

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::physfs::Filesystem 内被实现.


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