18#ifndef INCLUDED_PS_FILESYSTEM
19#define INCLUDED_PS_FILESYSTEM
102 std::unique_ptr<std::uint8_t[], AlignedDeleter>
m_Buffer;
std::uint32_t PSRETURN
Definition: Errors.h:75
void RegisterFileReloadFunc(FileReloadFunc func, void *obj)
register a callback function to be called by ReloadChangedFiles
Definition: Filesystem.cpp:51
ERROR_TYPE(CVFSFile, LoadFailed)
bool VfsDirectoryExists(const VfsPath &pathname)
Definition: Filesystem.cpp:45
void UnregisterFileReloadFunc(FileReloadFunc func, void *obj)
delete a callback function registered with RegisterFileReloadFunc (removes any with the same func and...
Definition: Filesystem.cpp:56
PIVFS g_VFS
Definition: Filesystem.cpp:36
bool VfsFileExists(const VfsPath &pathname)
Definition: Filesystem.cpp:40
Status ReloadChangedFiles()
poll for directory change notifications and reload all affected files.
Definition: Filesystem.cpp:82
Status(* FileReloadFunc)(void *param, const VfsPath &path)
callback function type for file change notifications
Definition: Filesystem.h:41
Reads a file, then gives read-only access to the contents.
Definition: Filesystem.h:70
~CVFSFile()
Definition: Filesystem.cpp:116
CStr8 GetAsString() const
Returns contents of file as a string.
Definition: Filesystem.cpp:152
std::unique_ptr< std::uint8_t[], AlignedDeleter > m_Buffer
Definition: Filesystem.h:102
PSRETURN Load(const PIVFS &vfs, const VfsPath &filename, bool log=true)
Returns either PSRETURN_OK or PSRETURN_CVFSFile_LoadFailed.
Definition: Filesystem.cpp:120
CVFSFile()
Definition: Filesystem.cpp:111
CStr8 DecodeUTF8() const
Returns contents of a UTF-8 encoded file as a string with optional BOM removed.
Definition: Filesystem.cpp:157
size_t m_BufferSize
Definition: Filesystem.h:103
const std::uint8_t * GetBuffer() const
Returns buffer of this file as a stream of bytes.
Definition: Filesystem.cpp:142
size_t GetBufferSize() const
Definition: Filesystem.cpp:147
def log(severity, message)
Definition: tests.py:27
Definition: vfs_util.cpp:42
std::int64_t Status
Error handling system.
Definition: status.h:174
std::shared_ptr< IVFS > PIVFS
Definition: vfs.h:240