Stroika Library 3.0d18
 
Loading...
Searching...
No Matches
Document/SQLite.inl
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4
6
7namespace Stroika::Foundation::Database::Document::SQLite {
8
9#if qStroika_HasComponent_sqlite
10 /*
11 ********************************************************************************
12 ****************************** SQLite::CompiledOptions *************************
13 ********************************************************************************
14 */
15 inline constexpr CompiledOptions CompiledOptions::kThe{
16#ifdef SQLITE_ENABLE_NORMALIZE
17 .ENABLE_NORMALIZE = true
18#else
19 .ENABLE_NORMALIZE = false
20#endif
21#ifdef SQLITE_THREADSAFE
22 ,
23 .THREADSAFE = SQLITE_THREADSAFE
24#elif defined(THREADSAFE)
25 ,
26 .THREADSAFE = THREADSAFE
27#else
28 , .THREADSAFE = 1
29#endif
30 };
31
32 /*
33 ********************************************************************************
34 ****************************** SQLite::Connection::Ptr *************************
35 ********************************************************************************
36 */
37 inline Connection::Ptr::Ptr (const Ptr& src)
38 : Ptr{Debug::UncheckedDynamicPointerCast<IRep> (src)}
39 {
40 }
41 inline Connection::Ptr& Connection::Ptr::operator= (const Ptr& src)
42 {
43 inherited::operator= (src);
44 return *this;
45 }
46 inline Connection::Ptr& Connection::Ptr::operator= (Ptr&& src) noexcept
47 {
48 inherited::operator= (move (src));
49 return *this;
50 }
51 inline Connection::IRep* Connection::Ptr::operator->() const noexcept
52 {
53 return Debug::UncheckedDynamicPointerCast<IRep> (*this).get ();
54 }
55 inline ::sqlite3* Connection::Ptr::Peek () const
56 {
57 return Debug::UncheckedDynamicPointerCast<IRep> (*this)->Peek ();
58 }
59 inline void Connection::Ptr::Exec (const String& sql)
60 {
61 this->operator->()->Exec (sql);
62 }
63#endif
64
65}
std::shared_ptr< T > UncheckedDynamicPointerCast(const std::shared_ptr< T1 > &arg) noexcept
Produce the same result as dynamic_pointer_cast if the successful case (non-null) - with better perfo...
Definition Cast.inl:42