1/// @brief VFS object definitions
4#include <cx/thread/rwlock.h>
10 VFSDir *root; ///< Root for namespaceless paths
12 // Namespaces are never case sensitive even if the paths are
13 [noinit] hashtable namespaces; ///< Hashtable of string/VFSDir
14 string curdir; ///< Current working directory of the VFS
15 RWLock vfslock; ///< vfslock is for adding entries to the directory cache
16 /// vfsdlock is for operations such as mounting / unmounting / invalidating cache
17 /// that may destroy VFSDir entries and remove mounts
21 /// Creates a new empty VFS instance with no mounted providers
23 /// The returned VFS contains no data sources. Use vfsMountFS() or
24 /// vfsMountProvider() to attach filesystem providers before accessing files.
26 /// @param flags Combination of VFS configuration flags (VFS_ReadOnly, VFS_CaseSensitive, etc.)
27 /// @return New VFS instance (never NULL, call objRelease() when done)
31 /// VFS *vfs = vfsCreate(0);
32 /// vfsMountFS(vfs, _S"/", _S"c:/data");
33 /// // ... use VFS ...
36 factory create(uint32 flags);
38 // hmm this is a comment
39 /// Creates a VFS pre-configured with OS filesystem access
41 /// Returns a VFS that mirrors the underlying OS filesystem. The exact
42 /// namespace configuration is platform-dependent:
43 /// - Windows: Each drive letter (c:, d:, etc.) is a separate namespace
44 /// - Unix: Single root namespace at /
46 /// The VFS case sensitivity is configured to match the OS default:
47 /// - Windows: Case-insensitive
48 /// - Unix: Case-sensitive
50 /// This is a convenience function equivalent to creating an empty VFS
51 /// and mounting the OS filesystem at the appropriate paths.
53 /// @return VFS instance mirroring OS filesystem, or NULL on failure
57 /// VFS *vfs = vfsCreateFromFS();
59 /// // VFS paths now map directly to OS filesystem
60 /// VFSFile *f = vfsOpen(vfs, _S"c:/data/file.txt", FS_Read);
63 [canfail] factory createFromFS();
67 object:ObjInst provider;
70 factory create(ObjInst *provider, uint32 flags);