Creating Virtual Files
Virtual files can be created explicitly or implicitly.
Explicit creation
Use the following functions:
- BoxedAppSDK_CreateVirtualFile creates a virtual file whose contents are stored in the shared memory.
- BoxedAppSDK_CreateVirtualFileBasedOnIStream creates a virtual file whose behavior is defined by your implementation of the standard
IStreaminterface. - BoxedAppSDK_CreateVirtualFileBasedOnBuffer creates a virtual file whose contents reside in a memory buffer that is used for both read and write operations.
- BoxedAppSDK_CreateVirtualDirectory creates a virtual directory whose contents are stored in the shared memory.
Implicit creation
A virtual file can also appear implicitly when the option "all changes are virtual" is enabled. In this mode, a virtual file is created automatically when you create a new file.
- If the parent directory was created with
BoxedAppSDK_CreateCustomVirtualDirectory, that same method is used to create the file inside it. - If the parent directory is neither a virtual directory nor one created with
BoxedAppSDK_CreateVirtualDirectory, then BoxedApp chooses the method based on what you are creating: for a regular file it usesBoxedAppSDK_CreateVirtualFile, and for a directory it usesBoxedAppSDK_CreateVirtualDirectory.