SQLite VFS Shim
Single header with classes for easily implementing SQLite VFS shims in C++11
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
sqlitevfs::SQLiteVfs< TVfsImpl > Struct Template Reference

#include <SQLiteVfs.hpp>

Inheritance diagram for sqlitevfs::SQLiteVfs< TVfsImpl >:

Public Types

using VfsImpl = TVfsImpl
 
using FileImpl = typename VfsImpl::FileImpl
 

Public Member Functions

 SQLiteVfs (const char *name)
 
 SQLiteVfs (const char *name, const char *base_vfs_name)
 
 SQLiteVfs (const char *name, sqlite3_vfs *original_vfs)
 
 ~SQLiteVfs ()
 
int register_vfs (bool makeDefault)
 
int unregister_vfs ()
 

Public Attributes

VfsImpl implementation
 

Detailed Description

template<typename TVfsImpl>
struct sqlitevfs::SQLiteVfs< TVfsImpl >

POD sqlite3_vfs subclass that forwards all invocations to an embedded object that inherits SQLiteVfsImpl.

You should not subclass this type. Pass your SQLiteVfsImpl subclass as template argument instead.

Template Parameters
TVfsImplSQLiteVfsImpl subclass

Member Typedef Documentation

◆ FileImpl

template<typename TVfsImpl >
using sqlitevfs::SQLiteVfs< TVfsImpl >::FileImpl = typename VfsImpl::FileImpl

◆ VfsImpl

template<typename TVfsImpl >
using sqlitevfs::SQLiteVfs< TVfsImpl >::VfsImpl = TVfsImpl

Constructor & Destructor Documentation

◆ SQLiteVfs() [1/3]

template<typename TVfsImpl >
sqlitevfs::SQLiteVfs< TVfsImpl >::SQLiteVfs ( const char *  name)
inline

Construct a named VFS with the default VFS as base.

Parameters
nameVFS name.
See also
SQLiteVfs(const char *, sqlite3_vfs *)

◆ SQLiteVfs() [2/3]

template<typename TVfsImpl >
sqlitevfs::SQLiteVfs< TVfsImpl >::SQLiteVfs ( const char *  name,
const char *  base_vfs_name 
)
inline

Construct a named VFS with the VFS named base_vfs_name as base.

Parameters
nameVFS name.
base_vfs_nameBase VFS name, used to find the base VFS using sqlite3_vfs_find.
See also
SQLiteVfs(const char *, sqlite3_vfs *)

◆ SQLiteVfs() [3/3]

template<typename TVfsImpl >
sqlitevfs::SQLiteVfs< TVfsImpl >::SQLiteVfs ( const char *  name,
sqlite3_vfs *  original_vfs 
)
inline

Construct a named VFS with original_vfs as base VFS.

The original_vfs will be forwarded to the implementation.

Warning
If a VFS is registered with a name that is NULL or an empty string, then the behavior is undefined.
Parameters
nameVFS name.
original_vfsBase VFS. If NULL, the default VFS will be used instead.
See also
SQLiteVfs(const char *, sqlite3_vfs *)

◆ ~SQLiteVfs()

template<typename TVfsImpl >
sqlitevfs::SQLiteVfs< TVfsImpl >::~SQLiteVfs ( )
inline

Unregisters the VFS, just to be sure.

See also
unregister_vfs

Member Function Documentation

◆ register_vfs()

template<typename TVfsImpl >
int sqlitevfs::SQLiteVfs< TVfsImpl >::register_vfs ( bool  makeDefault)
inline

Register the VFS in SQLite using sqlite3_vfs_register.

The same VFS can be registered multiple times without injury. To make an existing VFS into the default VFS, register it again with makeDefault flag set.

Parameters
makeDefaultWhether the VFS will be the new default VFS.
See also
https://sqlite.org/c3ref/vfs_find.html

◆ unregister_vfs()

template<typename TVfsImpl >
int sqlitevfs::SQLiteVfs< TVfsImpl >::unregister_vfs ( )
inline

Unregister the VFS in SQLite using sqlite3_vfs_unregister.

If the default VFS is unregistered, another VFS is chosen as the default arbitrarily.

See also
https://sqlite.org/c3ref/vfs_find.html

Member Data Documentation

◆ implementation

template<typename TVfsImpl >
VfsImpl sqlitevfs::SQLiteVfs< TVfsImpl >::implementation

VFS implementation object of the SQLiteVfsImpl subclass passed as template parameter to SQLiteVfs<>.


The documentation for this struct was generated from the following file: