CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
vfsfs.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/vfsprovider.h>
7
8typedef struct VFSFS VFSFS;
9typedef struct VFSFS_WeakRef VFSFS_WeakRef;
10saDeclarePtr(VFSFS);
11saDeclarePtr(VFSFS_WeakRef);
12
13typedef struct VFSFS_ClassIf {
14 ObjIface* _implements;
15 ObjIface* _parent;
16 size_t _size;
17
18 // VFSProviderFlags enforced for this provider
19 flags_t (*flags)(_In_ void* self);
20 // returns an object that implements VFSFileProvider
21 _Ret_opt_valid_ ObjInst* (*open)(_In_ void* self, _In_opt_ strref path, flags_t flags);
22 FSPathStat (*stat)(_In_ void* self, _In_opt_ strref path, _When_(return != FS_Nonexistent, _Out_opt_) FSStat* stat);
23 bool (*setTimes)(_In_ void* self, _In_opt_ strref path, int64 modified, int64 accessed);
24 bool (*createDir)(_In_ void* self, _In_opt_ strref path);
25 bool (*removeDir)(_In_ void* self, _In_opt_ strref path);
26 bool (*deleteFile)(_In_ void* self, _In_opt_ strref path);
27 bool (*rename)(_In_ void* self, _In_opt_ strref oldpath, _In_opt_ strref newpath);
28 bool (*getFSPath)(_In_ void* self, _Inout_ string* out, _In_opt_ strref path);
29 bool (*searchInit)(_In_ void* self, _Out_ FSSearchIter* iter, _In_opt_ strref path, _In_opt_ strref pattern, bool stat);
30 bool (*searchValid)(_In_ void* self, _In_ FSSearchIter* iter);
31 bool (*searchNext)(_In_ void* self, _Inout_ FSSearchIter* iter);
32 void (*searchFinish)(_In_ void* self, _Inout_ FSSearchIter* iter);
33} VFSFS_ClassIf;
34extern VFSFS_ClassIf VFSFS_ClassIf_tmpl;
35
36typedef struct VFSFS {
37 union {
38 VFSFS_ClassIf* _;
39 void* _is_VFSFS;
40 void* _is_ObjInst;
41 };
42 ObjClassInfo* _clsinfo;
43 atomic(uintptr) _ref;
44 atomic(ptr) _weakref;
45
46 string root;
47} VFSFS;
48extern ObjClassInfo VFSFS_clsinfo;
49#define VFSFS(inst) ((VFSFS*)(unused_noeval((inst) && &((inst)->_is_VFSFS)), (inst)))
50#define VFSFSNone ((VFSFS*)NULL)
51
52typedef struct VFSFS_WeakRef {
53 union {
54 ObjInst* _inst;
55 void* _is_VFSFS_WeakRef;
56 void* _is_ObjInst_WeakRef;
57 };
58 atomic(uintptr) _ref;
59 RWLock _lock;
60} VFSFS_WeakRef;
61#define VFSFS_WeakRef(inst) ((VFSFS_WeakRef*)(unused_noeval((inst) && &((inst)->_is_VFSFS_WeakRef)), (inst)))
62
63_objfactory_check VFSFS* VFSFS_create(_In_opt_ strref rootpath);
64// VFSFS* vfsfsCreate(strref rootpath);
65#define vfsfsCreate(rootpath) VFSFS_create(rootpath)
66
67// flags_t vfsfsFlags(VFSFS* self);
68//
69// VFSProviderFlags enforced for this provider
70#define vfsfsFlags(self) (self)->_->flags(VFSFS(self))
71// ObjInst* vfsfsOpen(VFSFS* self, strref path, flags_t flags);
72//
73// returns an object that implements VFSFileProvider
74#define vfsfsOpen(self, path, flags) (self)->_->open(VFSFS(self), path, flags)
75// FSPathStat vfsfsStat(VFSFS* self, strref path, FSStat* stat);
76#define vfsfsStat(self, path, stat) (self)->_->stat(VFSFS(self), path, stat)
77// bool vfsfsSetTimes(VFSFS* self, strref path, int64 modified, int64 accessed);
78#define vfsfsSetTimes(self, path, modified, accessed) (self)->_->setTimes(VFSFS(self), path, modified, accessed)
79// bool vfsfsCreateDir(VFSFS* self, strref path);
80#define vfsfsCreateDir(self, path) (self)->_->createDir(VFSFS(self), path)
81// bool vfsfsRemoveDir(VFSFS* self, strref path);
82#define vfsfsRemoveDir(self, path) (self)->_->removeDir(VFSFS(self), path)
83// bool vfsfsDeleteFile(VFSFS* self, strref path);
84#define vfsfsDeleteFile(self, path) (self)->_->deleteFile(VFSFS(self), path)
85// bool vfsfsRename(VFSFS* self, strref oldpath, strref newpath);
86#define vfsfsRename(self, oldpath, newpath) (self)->_->rename(VFSFS(self), oldpath, newpath)
87// bool vfsfsGetFSPath(VFSFS* self, string* out, strref path);
88#define vfsfsGetFSPath(self, out, path) (self)->_->getFSPath(VFSFS(self), out, path)
89// bool vfsfsSearchInit(VFSFS* self, FSSearchIter* iter, strref path, strref pattern, bool stat);
90#define vfsfsSearchInit(self, iter, path, pattern, stat) (self)->_->searchInit(VFSFS(self), iter, path, pattern, stat)
91// bool vfsfsSearchValid(VFSFS* self, FSSearchIter* iter);
92#define vfsfsSearchValid(self, iter) (self)->_->searchValid(VFSFS(self), iter)
93// bool vfsfsSearchNext(VFSFS* self, FSSearchIter* iter);
94#define vfsfsSearchNext(self, iter) (self)->_->searchNext(VFSFS(self), iter)
95// void vfsfsSearchFinish(VFSFS* self, FSSearchIter* iter);
96#define vfsfsSearchFinish(self, iter) (self)->_->searchFinish(VFSFS(self), iter)
97
#define saDeclarePtr(name)
Definition sarray.h:98
enum FSPathStatEnum FSPathStat
@ FS_Nonexistent
Path does not exist.
Definition fs.h:94
#define _objfactory_check
Definition objimpl.h:110
CX Object System - Object-oriented programming in C.
Definition fs.h:103