CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
vfsprovider.h
1#pragma once
2// This header file is auto-generated!
3// Do not make changes to this file or they will be overwritten.
4// clang-format off
5#include <cx/obj.h>
6#include <cx/fs/fs.h>
7#include <cx/fs/file.h>
8
9
10typedef struct VFSFileProvider {
11 ObjIface* _implements;
12 ObjIface* _parent;
13 size_t _size;
14
15 bool (*close)(_In_ void* self);
16 bool (*read)(_In_ void* self, _Out_writes_bytes_to_(sz, *bytesread) void* buf, size_t sz, _Out_ _Deref_out_range_(0, sz) size_t* bytesread);
17 bool (*write)(_In_ void* self, _In_reads_bytes_(sz) void* buf, size_t sz, _Out_opt_ _Deref_out_range_(0, sz) size_t* byteswritten);
18 int64 (*tell)(_In_ void* self);
19 int64 (*seek)(_In_ void* self, int64 off, FSSeekType seektype);
20 bool (*flush)(_In_ void* self);
21} VFSFileProvider;
22extern VFSFileProvider VFSFileProvider_tmpl;
23
24typedef struct VFSProvider {
25 ObjIface* _implements;
26 ObjIface* _parent;
27 size_t _size;
28
29 // VFSProviderFlags enforced for this provider
30 flags_t (*flags)(_In_ void* self);
31 // returns an object that implements VFSFileProvider
32 _Ret_opt_valid_ ObjInst* (*open)(_In_ void* self, _In_opt_ strref path, flags_t flags);
33 FSPathStat (*stat)(_In_ void* self, _In_opt_ strref path, _When_(return != FS_Nonexistent, _Out_opt_) FSStat* stat);
34 bool (*setTimes)(_In_ void* self, _In_opt_ strref path, int64 modified, int64 accessed);
35 bool (*createDir)(_In_ void* self, _In_opt_ strref path);
36 bool (*removeDir)(_In_ void* self, _In_opt_ strref path);
37 bool (*deleteFile)(_In_ void* self, _In_opt_ strref path);
38 bool (*rename)(_In_ void* self, _In_opt_ strref oldpath, _In_opt_ strref newpath);
39 bool (*getFSPath)(_In_ void* self, _Inout_ string* out, _In_opt_ strref path);
40 bool (*searchInit)(_In_ void* self, _Out_ FSSearchIter* iter, _In_opt_ strref path, _In_opt_ strref pattern, bool stat);
41 bool (*searchValid)(_In_ void* self, _In_ FSSearchIter* iter);
42 bool (*searchNext)(_In_ void* self, _Inout_ FSSearchIter* iter);
43 void (*searchFinish)(_In_ void* self, _Inout_ FSSearchIter* iter);
44} VFSProvider;
45extern VFSProvider VFSProvider_tmpl;
46
Low-level file I/O operations.
Platform-specific filesystem operations.
enum FSSeekTypeEnum FSSeekType
enum FSPathStatEnum FSPathStat
@ FS_Nonexistent
Path does not exist.
Definition fs.h:94
CX Object System - Object-oriented programming in C.
Definition fs.h:103