27 #include "precompiled.h"
45 const int ret =
wmkdir(path, mode);
59 const int ret =
wstat(path, &s);
84 directory = startDirectory;
104 const size_t nextSlash = pathname.
string().find_first_of(
'/', pos);
105 if(nextSlash == VfsPath::String::npos)
107 const VfsPath subdirectoryName = pathname.
string().substr(pos, nextSlash-pos);
113 if(addMissingDirectories)
125 currentPath = currentPath / subdirectoryName;
136 directory = subdirectory;
143 *pfile = directory->
GetFile(filename);
Status vfs_Lookup(const VfsPath &pathname, VfsDirectory *startDirectory, VfsDirectory *&directory, VfsFile **pfile, size_t flags)
Resolve a pathname.
const Status VFS_DIR_NOT_FOUND
const PRealDirectory & AssociatedDirectory() const
VfsFile * GetFile(const VfsPath &name)
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
shared_ptr< RealDirectory > PRealDirectory
const String & string() const
Status vfs_Attach(VfsDirectory *directory, const PRealDirectory &realDirectory)
attach a real directory to a VFS directory.
const Status VFS_FILE_NOT_FOUND
i64 Status
Error handling system.
#define DEBUG_WARN_ERR(status)
display the error dialog with text corresponding to the given error code.
Status vfs_Populate(VfsDirectory *directory)
populate the directory from the attached real directory.
LIB_API int wmkdir(const OsPath &path, mode_t mode)
#define WARN_RETURN(status)
static Status CreateDirectory(const OsPath &path)
VfsDirectory * GetSubdirectory(const VfsPath &name)
LIB_API int wstat(const OsPath &pathname, struct stat *buf)
VfsDirectory * AddSubdirectory(const VfsPath &name)
void debug_printf(const wchar_t *fmt,...)
write a formatted string to the debug channel, subject to filtering (see below).
#define RETURN_STATUS_IF_ERR(expression)
mark a directory replaceable, so that when writing a file to this path new real directories will be c...