Solid File System

Virtual file system enigne that can be embedded into your software.

SolFSStorage constructor (opens the storage in callback mode)

Filter:

Pascal    Plain C    C++ (DLL/Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET    Java 

SolFSStorage     See also    

Overview

Creates storage object and opens storage in callback mode.

Declaration

[Pascal]
    constructor CreateCB( FileName: TSolFSString; PageSize: LongWord=512; CreateNew: Boolean=False; Logo: TSolFSString=''; PathSeparator: WideChar='/'; UseTransactions: Boolean=False; UseAccessTime: Boolean=False; OpenReadOnly : boolean = false; OnCreateFile : TSolFSCreateFileEvent = nil; OnOpenFile : TSolFSOpenFileEvent = nil; OnCloseFile : TSolFSCloseFileEvent = nil; OnFlushFile : TSolFSFlushFileEvent = nil; OnDeleteFile : TSolFSDeleteFileEvent = nil; OnGetFileSize : TSolFSGetFileSizeEvent = nil; OnSetFileSize : TSolFSSetFileSizeEvent = nil; OnSeekFile : TSolFSSeekFileEvent = nil; OnReadFile : TSolFSReadFileEvent = nil; OnWriteFile : TSolFSWriteFileEvent = nil);

    type TSolFSString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[Plain C]
    long _stdcall StorageCreateCB( const wchar_t* FileName, char Overwrite, unsigned long PageSize, wchar_t* Logo, unsigned long* Storage, wchar_t PathSeparator, char UseTransactions, char UseAccessTime, bool ReadOnly, CallbackDataType UserData, SolFSCreateFileFunc CreateFileFunc, SolFSOpenFileFunc OpenFileFunc, SolFSCloseFileFunc CloseFileFunc, SolFSFlushFileFunc FlushFileFunc, SolFSDeleteFileFunc DeleteFileFunc, SolFSGetFileSizeFunc GetFileSizeFunc, SolFSSetFileSizeFunc SetFileSizeFunc, SolFSSeekFileFunc SeekFileFunc, SolFSReadFileFunc ReadFileFunc, SolFSWriteFileFunc WriteFileFunc);

[C++ (DLL/Lib)]
    SolFSStorage(unsigned short * fileName, bool useTransactions, bool useLastAccessTime, wchar_t pathSeparator, bool ReadOnly, CallbackDataType UserData, SolFSCreateFileEvent* OnCreateFile, SolFSOpenFileEvent* OnOpenFile, SolFSCloseFileEvent* OnCloseFile, SolFSFlushFileEvent* OnFlushFile, SolFSDeleteFileEvent* OnDeleteFile, SolFSGetFileSizeEvent* OnGetFileSize, SolFSSetFileSizeEvent* OnSetFileSize, SolFSSeekFileEvent* OnSeekFile, SolFSReadFileEvent*SolFSReadFileEvent* OnReadFile, SolFSWriteFileEvent* OnWriteFile);
    SolFSStorage(unsigned short * fileName, bool overwrite, int pageSize, bool useTransactions, bool useLastAccessTime, wchar_t pathSeparator, unsigned short * logo, CallbackDataType UserData, SolFSCreateFileEvent* OnCreateFile, SolFSOpenFileEvent* OnOpenFile, SolFSCloseFileEvent* OnCloseFile, SolFSFlushFileEvent* OnFlushFile, SolFSDeleteFileEvent* OnDeleteFile, SolFSGetFileSizeEvent* OnGetFileSize, SolFSSetFileSizeEvent* OnSetFileSize, SolFSSeekFileEvent* OnSeekFile, SolFSReadFileEvent*SolFSReadFileEvent* OnReadFile, SolFSWriteFileEvent* OnWriteFile);

[C++ (VCL)]
    TSolFSStorage(TSolFSString FileName, unsigned PageSize, bool CreateNew, bool ReadOnly, TSolFSString Logo, bool UseTransactions=true, bool UseAccessTime=false, WideChar PathSeparator='/', bool OpenReadOnly = false, TSolFSCreateFileEvent OnCreateFile = NULL, TSolFSOpenFileEvent OnOpenFile = NULL, TSolFSCloseFileEvent OnCloseFile = NULL, TSolFSFlushFileEvent OnFlushFile = NULL, TSolFSDeleteFileEvent OnDeleteFile = NULL, TSolFSGetFileSizeEvent OnGetFileSize = NULL, TSolFSSetFileSizeEvent OnSetFileSize = NULL, TSolFSSeekFileEvent OnSeekFile = NULL, TSolFSReadFileEventTSolFSReadFileEvent OnReadFile = NULL, TSolFSWriteFileEvent OnWriteFile = NULL);

[C++ (.NET)]
    SolFSStorage(String* fileName, bool useTransactions, bool useLastAccessTime, wchar_t pathSeparator, bool ReadOnly, SolFSCreateFileEvent* OnCreateFile, SolFSOpenFileEvent* OnOpenFile, SolFSCloseFileEvent* OnCloseFile, SolFSFlushFileEvent* OnFlushFile, SolFSDeleteFileEvent* OnDeleteFile, SolFSGetFileSizeEvent* OnGetFileSize, SolFSSetFileSizeEvent* OnSetFileSize, SolFSSeekFileEvent* OnSeekFile, SolFSReadFileEvent*SolFSReadFileEvent* OnReadFile, SolFSWriteFileEvent* OnWriteFile);
    SolFSStorage(String* fileName, bool overwrite, int pageSize, bool useTransactions, bool useLastAccessTime, wchar_t pathSeparator, String* logo, SolFSCreateFileEvent* OnCreateFile, SolFSOpenFileEvent* OnOpenFile, SolFSCloseFileEvent* OnCloseFile, SolFSFlushFileEvent* OnFlushFile, SolFSDeleteFileEvent* OnDeleteFile, SolFSGetFileSizeEvent* OnGetFileSize, SolFSSetFileSizeEvent* OnSetFileSize, SolFSSeekFileEvent* OnSeekFile, SolFSReadFileEvent*SolFSReadFileEvent* OnReadFile, SolFSWriteFileEvent* OnWriteFile);

[C#]
    SolFSStorage(string fileName, bool useTransactions, bool useLastAccessTime, char pathSeparator, bool ReadOnly, SolFSCreateFileEvent OnCreateFile, SolFSOpenFileEvent OnOpenFile, SolFSCloseFileEvent OnCloseFile, SolFSFlushFileEvent OnFlushFile, SolFSDeleteFileEvent OnDeleteFile, SolFSGetFileSizeEvent OnGetFileSize, SolFSSetFileSizeEvent OnSetFileSize, SolFSSeekFileEvent OnSeekFile, SolFSReadFileEventSolFSReadFileEvent OnReadFile, SolFSWriteFileEvent OnWriteFile);
    SolFSStorage(string fileName, bool overwrite, int pageSize, bool useTransactions, bool useLastAccessTime, char pathSeparator, string logo SolFSCreateFileEvent OnCreateFile, SolFSOpenFileEvent OnOpenFile, SolFSCloseFileEvent OnCloseFile, SolFSFlushFileEvent OnFlushFile, SolFSDeleteFileEvent OnDeleteFile, SolFSGetFileSizeEvent OnGetFileSize, SolFSSetFileSizeEvent OnSetFileSize, SolFSSeekFileEvent OnSeekFile, SolFSReadFileEventSolFSReadFileEvent OnReadFile, SolFSWriteFileEvent OnWriteFile);

[VB.NET]
    SolFSStorage(fileName As String, useTransactions As Boolean, useLastAccessTime As Boolean, pathSeparator As Char, ReadOnly as Boolean, OnCreateFile As SolFSCreateFileEvent, OnOpenFile As SolFSOpenFileEvent, OnCloseFile As SolFSCloseFileEvent, OnFlushFile As SolFSFlushFileEvent, OnDeleteFile As SolFSDeleteFileEvent, OnGetFileSize As SolFSGetFileSizeEvent, OnSetFileSize As SolFSSetFileSizeEvent, OnSeekFile As SolFSSeekFileEvent, OnReadFile As SolFSReadFileEvent, OnWriteFile As SolFSWriteFileEvent)
    SolFSStorage(fileName As String, overwrite As Boolean, pageSize As Integer, useTransactions As Boolean, useLastAccessTime As Boolean, pathSeparator As Char, logo As String, OnCreateFile As SolFSCreateFileEvent, OnOpenFile As SolFSOpenFileEvent, OnCloseFile As SolFSCloseFileEvent, OnFlushFile As SolFSFlushFileEvent, OnDeleteFile As SolFSDeleteFileEvent, OnGetFileSize As SolFSGetFileSizeEvent, OnSetFileSize As SolFSSetFileSizeEvent, OnSeekFile As SolFSSeekFileEvent, OnReadFile As SolFSReadFileEvent, OnWriteFile As SolFSWriteFileEvent)

[Java]
    void createCB(String fileName, boolean Overwrite, long pageSize, String logo)

Parameters

  • FileName - specifies the name of the storage file on physical media.
  • PageSize - specifies default page size (when creating new storage).
  • CreateNew - set this parameter as True if new storage must be created and as False if existent one will be used.
  • Logo -
  • PathSeparator - specifies the separator which will be used in further storage operations.
  • UseTransactions - set this parameter to True to enable transactions and journalling. Note, that transactions slow down file write operations significantly.
  • UseAccessTime - defines whether last access time is written to storage when the file/folder is accessed. Writing access time slows down the operations.
  • Overwrite - specifies whether the Storage parameter must be overwrited if it is already exists.
  • OpenReadOnly - specifies if the storage must be opened-in readonly mode. This is applicable only to storages that already exist (ie. not created with this call).
  • delegates (event handlers) - see corresponding delegate/event type description.
  • [Plain C] Storage - returns handle to the created SolFSStorage.
  • [Plain C] UserData - application-defined parameter which is passed back to callback function.

[Plain C]  Return values

0 if the function succeeded or one of Error codes if the function failed.

Description

Use this constructor to create or open a storage in callback mode.
Callback mode lets you keep a storage on any media and not only on physical disk.
If some of delegates/event handlers are not specified, constructor will fail.

[DLL] Note: this method creates new storage. To open a storage use Open and OpenCB functions.

Read more about callback mode.

OPERATING SYSTEM EDITION for Windows:
Before using this method you need to call Initialize method to initialize SolFS.

See also

PathSeparator     UseAccessTime     UseTransactions     Constructor     Constructor (opens the storage)     Initialize     [DLL]Open     [DLL]OpenCB    

Back to top