18 #include "precompiled.h"
60 const wchar_t* extensionsToIgnore[] = { L
".xmb", L
".tmp" };
61 for(
size_t i = 0; i <
ARRAY_SIZE(extensionsToIgnore); i++)
63 if(extension == extensionsToIgnore[i])
74 std::vector<DirWatchNotification> notifications;
76 for(
size_t i = 0; i < notifications.size(); i++)
100 #if BOOST_FILESYSTEM_VERSION == 3
101 return path.wstring();
103 return path.string();
129 LOGERROR(L
"CVFSFile: file %ls couldn't be opened (vfs_load: %lld)", filename.
string().c_str(), (
long long)ret);
158 if (
GetBufferSize() >= 3 && buffer[0] == 0xEF && buffer[1] == 0xBB && buffer[2] == 0xBF)
static bool CanIgnore(const DirWatchNotification ¬ification)
CStr DecodeUTF8() const
Returns contents of a UTF-8 encoded file as a string with optional BOM removed.
const OsPath & Pathname() const
const PSRETURN PSRETURN_CVFSFile_LoadFailed
const PSRETURN PSRETURN_OK
std::wstring GetWstringFromWpath(const fs::wpath &path)
Helper function to handle API differences between Boost Filesystem v2 and v3.
CStr GetAsString() const
Returns contents of file as a string.
const PSRETURN PSRETURN_CVFSFile_AlreadyLoaded
Status(* FileReloadFunc)(void *param, const VfsPath &path)
callback function type for file change notifications
Status ReloadChangedFiles()
poll for directory change notifications and reload all affected files.
void UnregisterFileReloadFunc(FileReloadFunc func, void *obj)
delete a callback function registered with RegisterFileReloadFunc (removes any with the same func and...
void RegisterFileReloadFunc(FileReloadFunc func, void *obj)
register a callback function to be called by ReloadChangedFiles
const String & string() const
LIB_API Status dir_watch_Poll(DirWatchNotifications ¬ifications)
return all pending directory watch notifications.
Status h_reload(const PIVFS &vfs, const VfsPath &pathname)
const u8 * GetBuffer() const
Returns buffer of this file as a stream of bytes.
i64 Status
Error handling system.
#define DEBUG_WARN_ERR(status)
display the error dialog with text corresponding to the given error code.
shared_ptr< u8 > m_Buffer
PSRETURN Load(const PIVFS &vfs, const VfsPath &filename)
Returns either PSRETURN_OK or PSRETURN_CVFSFile_LoadFailed.
bool VfsFileExists(const VfsPath &pathname)
size_t GetBufferSize() const
static std::vector< std::pair< FileReloadFunc, void * > > g_ReloadFuncs
Status ReloadChangedFiles(const VfsPath &path)
Call when a file has bee modified, to hotload pages if their .xml files changed.
#define RETURN_STATUS_IF_ERR(expression)