ThinSQLite++
A thin, safe and convenient modern C++ wrapper for SQLite API.
Loading...
Searching...
No Matches
sqlite_version Class Reference

Representation of SQLite version. More...

Public Member Functions

constexpr sqlite_version (int val)
 Construct an instance from an int encoded in SQLite format.
 
constexpr std::tuple< unsigned, unsigned, unsigned > parts () const noexcept
 Break an instance into constituent parts.
 
constexpr int value () const noexcept
 Get the stored SQLite version value.
 

Static Public Member Functions

static constexpr sqlite_version from_parts (unsigned major, unsigned minor, unsigned release)
 Construct an instance from major, minor, release parts.
 
static constexpr sqlite_version compile_time () noexcept
 Returns the compile time SQLite version.
 
static sqlite_version runtime () noexcept
 Returns the runtime SQLite version.
 
static constexpr const char * compile_time_str () noexcept
 Returns the compile time SQLite version as a string.
 
static const char * runtime_str () noexcept
 Returns the runtime SQLite version as a string.
 
static constexpr const char * compile_time_sourceid () noexcept
 Returns the compile time SQLite source identifier.
 
static const char * runtime_sourceid () noexcept
 Returns the runtime SQLite source identifier.
 

Friends

constexpr bool operator== (const sqlite_version &lhs, const sqlite_version &rhs) noexcept
 
constexpr bool operator!= (const sqlite_version &lhs, const sqlite_version &rhs) noexcept
 
constexpr std::strong_ordering operator<=> (const sqlite_version &lhs, const sqlite_version &rhs) noexcept
 
constexpr bool operator< (const sqlite_version &lhs, const sqlite_version &rhs) noexcept
 
constexpr bool operator<= (const sqlite_version &lhs, const sqlite_version &rhs) noexcept
 
constexpr bool operator> (const sqlite_version &lhs, const sqlite_version &rhs) noexcept
 
constexpr bool operator>= (const sqlite_version &lhs, const sqlite_version &rhs) noexcept
 

Detailed Description

Representation of SQLite version.

This class wraps usage of SQLite version numbers which are encoded as integers with the value major*1000000 + minor*1000 + release.

It provides wrappers for SQLite functions that obtain runtime SQLite version information and constexpr wrapper for compile-time version info.

Member Function Documentation

◆ parts()

std::tuple< unsigned, unsigned, unsigned > parts ( ) const
inlineconstexprnoexcept

Break an instance into constituent parts.

The intended usage is

auto [major, minor, release] = ver.parts();

◆ compile_time()

static constexpr sqlite_version compile_time ( )
inlinestaticconstexprnoexcept

Returns the compile time SQLite version.

Equivalent to SQLITE_VERSION_NUMBER

◆ runtime()

static sqlite_version runtime ( )
inlinestaticnoexcept

Returns the runtime SQLite version.

Equivalent to sqlite3_libversion_number

◆ compile_time_str()

static constexpr const char * compile_time_str ( )
inlinestaticconstexprnoexcept

Returns the compile time SQLite version as a string.

Equivalent to SQLITE_VERSION

◆ runtime_str()

static const char * runtime_str ( )
inlinestaticnoexcept

Returns the runtime SQLite version as a string.

Equivalent to sqlite3_libversion

◆ compile_time_sourceid()

static constexpr const char * compile_time_sourceid ( )
inlinestaticconstexprnoexcept

Returns the compile time SQLite source identifier.

Equivalent to SQLITE_SOURCE_ID

◆ runtime_sourceid()

static const char * runtime_sourceid ( )
inlinestaticnoexcept

Returns the runtime SQLite source identifier.

Equivalent to sqlite3_sourceid