CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
vfsprovider.cxh
1#include <cx/fs/fs.h>
2#include <cx/fs/file.h>
3
4interface VFSFileProvider {
5 bool close();
6
7 bool read([sal _Out_writes_bytes_to_(sz, *bytesread)] void *buf, size_t sz, [out] [sal _Deref_out_range_(0, sz)] size_t *bytesread);
8 bool write([sal _In_reads_bytes_(sz)] void *buf, size_t sz, [out] [opt] [sal _Deref_out_range_(0, sz)] size_t *byteswritten);
9 int64 tell();
10 int64 seek(int64 off, FSSeekType seektype);
11 bool flush();
12}
13
14interface VFSProvider {
15 flags_t flags(); // VFSProviderFlags enforced for this provider
16
17 [opt] ObjInst *open(strref path, flags_t flags); // returns an object that implements VFSFileProvider
18 FSPathStat stat(strref path, [sal _When_(return != FS_Nonexistent, _Out_opt_)] FSStat *stat);
19 bool setTimes(strref path, int64 modified, int64 accessed);
20 bool createDir(strref path);
21 bool removeDir(strref path);
22 bool deleteFile(strref path);
23 bool rename(strref oldpath, strref newpath);
24 bool getFSPath([inout] string *out, strref path);
25
26 bool searchInit([out] FSSearchIter *iter, strref path, strref pattern, bool stat);
27 bool searchValid([in] FSSearchIter *iter);
28 bool searchNext([inout] FSSearchIter *iter);
29 void searchFinish([inout] FSSearchIter *iter);
30}