36#include <cx/fs/vfsprovider.h>
70bool _vfsMountProvider(_Inout_
VFS* vfs, _Inout_
ObjInst* provider, _In_opt_ strref path,
91#define vfsMountProvider(vfs, provider, path, ...) \
92 _vfsMountProvider(vfs, objInstBase(provider), path, opt_flags(__VA_ARGS__))
94bool _vfsMountFS(_Inout_
VFS* vfs, _In_opt_ strref path, _In_opt_ strref fsroot, flags_t flags);
116#define vfsMountFS(vfs, path, fsroot, ...) _vfsMountFS(vfs, path, fsroot, opt_flags(__VA_ARGS__))
118bool _vfsMountVFS(_Inout_
VFS* vfs, _In_opt_ strref path, _Inout_
VFS* vfs2,
119 _In_opt_ strref vfs2root, flags_t flags);
143#define vfsMountVFS(vfs, path, vfs2, vfs2root, ...) \
144 _vfsMountVFS(vfs, path, vfs2, vfs2root, opt_flags(__VA_ARGS__))
175#define _vfsStatAnno _Success_(return != FS_Nonexistent)
228bool vfsSetTimes(_Inout_
VFS* vfs, _In_opt_ strref path, int64 modified, int64 accessed);
278bool vfsCopy(_Inout_
VFS* vfs, _In_opt_ strref from, _In_opt_ strref to);
290bool vfsRename(_Inout_
VFS* vfs, _In_opt_ strref from, _In_opt_ strref to);
327 _In_opt_ strref pattern,
int typefilter,
bool stat);
349 return iter->_search;
385bool vfsRead(_Inout_
VFSFile* file, _Out_writes_bytes_to_(sz, *bytesread)
void* buf,
size_t sz,
386 _Out_ _Deref_out_range_(0, sz)
size_t* bytesread);
399 _Out_opt_ _Deref_out_range_(0, sz)
size_t* byteswritten);
Low-level file I/O operations.
Platform-specific filesystem operations.
enum FSSeekTypeEnum FSSeekType
enum FSPathStatEnum FSPathStat
@ FS_Directory
Path is a directory.
@ FS_File
Path is a regular file.
@ FS_Nonexistent
Path does not exist.
bool vfsSearchValid(FSSearchIter *iter)
bool vfsWrite(VFSFile *file, void *buf, size_t sz, size_t *byteswritten)
void vfsCurDir(VFS *vfs, string *out)
bool vfsSearchInit(FSSearchIter *iter, VFS *vfs, strref path, strref pattern, int typefilter, bool stat)
bool vfsCreateAll(VFS *vfs, strref path)
void vfsSearchFinish(FSSearchIter *iter)
bool vfsDelete(VFS *vfs, strref path)
FSPathStat vfsStat(VFS *vfs, strref path, FSStat *stat)
bool vfsIsDir(VFS *vfs, strref path)
bool vfsSearchNext(FSSearchIter *iter)
bool vfsFlush(VFSFile *file)
bool vfsRemoveDir(VFS *vfs, strref path)
void vfsDestroy(VFS **pvfs)
VFSFile * vfsOpen(VFS *vfs, strref path, flags_t flags)
bool vfsUnmount(VFS *vfs, strref path)
bool vfsWriteString(VFSFile *file, strref str, size_t *byteswritten)
bool vfsExist(VFS *vfs, strref path)
void vfsAbsolutePath(VFS *vfs, string *out, strref path)
int64 vfsSeek(VFSFile *file, int64 off, FSSeekType seektype)
bool vfsCopy(VFS *vfs, strref from, strref to)
bool vfsCreateDir(VFS *vfs, strref path)
bool vfsRead(VFSFile *file, void *buf, size_t sz, size_t *bytesread)
bool vfsGetFSPath(string *out, VFS *vfs, strref path)
bool vfsClose(VFSFile *file)
bool vfsSetTimes(VFS *vfs, strref path, int64 modified, int64 accessed)
bool vfsSetCurDir(VFS *vfs, strref cur)
bool vfsRename(VFS *vfs, strref from, strref to)
bool vfsIsFile(VFS *vfs, strref path)
int64 vfsTell(VFSFile *file)
FSStat stat
File metadata (only valid if stat=true in fsSearchInit)