Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
SQLiteIniter Class Reference

Public Member Functions

 SQLiteIniter ()
 
 ~SQLiteIniter ()
 

Static Public Member Functions

static void LogCallback (void *WXUNUSED(arg), int code, const char *msg)
 

Public Attributes

int mRc
 

Detailed Description

Definition at line 176 of file ProjectFileIO.cpp.

Constructor & Destructor Documentation

◆ SQLiteIniter()

SQLiteIniter::SQLiteIniter ( )
inline

Definition at line 179 of file ProjectFileIO.cpp.

180 {
181 // Enable URI filenames for all connections
182 mRc = sqlite3_config(SQLITE_CONFIG_URI, 1);
183 if (mRc == SQLITE_OK)
184 {
185 mRc = sqlite3_config(SQLITE_CONFIG_LOG, LogCallback, nullptr);
186 if (mRc == SQLITE_OK)
187 {
188 mRc = sqlite3_initialize();
189 }
190 }
191
192#ifdef NO_SHM
193 if (mRc == SQLITE_OK)
194 {
195 // Use the "unix-excl" VFS to make access to the DB exclusive. This gets
196 // rid of the "<database name>-shm" shared memory file.
197 //
198 // Though it shouldn't, it doesn't matter if this fails.
199 auto vfs = sqlite3_vfs_find("unix-excl");
200 if (vfs)
201 {
202 sqlite3_vfs_register(vfs, 1);
203 }
204 }
205#endif
206 }
static void LogCallback(void *WXUNUSED(arg), int code, const char *msg)

References LogCallback(), and mRc.

Here is the call graph for this function:

◆ ~SQLiteIniter()

SQLiteIniter::~SQLiteIniter ( )
inline

Definition at line 207 of file ProjectFileIO.cpp.

208 {
209 // This function must be called single-threaded only
210 // It returns a value, but there's nothing we can do with it
211 (void) sqlite3_shutdown();
212 }

Member Function Documentation

◆ LogCallback()

static void SQLiteIniter::LogCallback ( void *  WXUNUSEDarg,
int  code,
const char *  msg 
)
inlinestatic

Definition at line 214 of file ProjectFileIO.cpp.

215 {
216 wxLogMessage("sqlite3 message: (%d) %s", code, msg);
217 }

Referenced by SQLiteIniter().

Here is the caller graph for this function:

Member Data Documentation

◆ mRc

int SQLiteIniter::mRc

Definition at line 219 of file ProjectFileIO.cpp.

Referenced by ProjectFileIO::InitializeSQL(), and SQLiteIniter().


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