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 170 of file ProjectFileIO.cpp.

Constructor & Destructor Documentation

◆ SQLiteIniter()

SQLiteIniter::SQLiteIniter ( )
inline

Definition at line 173 of file ProjectFileIO.cpp.

174 {
175 // Enable URI filenames for all connections
176 mRc = sqlite3_config(SQLITE_CONFIG_URI, 1);
177 if (mRc == SQLITE_OK)
178 {
179 mRc = sqlite3_config(SQLITE_CONFIG_LOG, LogCallback, nullptr);
180 if (mRc == SQLITE_OK)
181 {
182 mRc = sqlite3_initialize();
183 }
184 }
185
186#ifdef NO_SHM
187 if (mRc == SQLITE_OK)
188 {
189 // Use the "unix-excl" VFS to make access to the DB exclusive. This gets
190 // rid of the "<database name>-shm" shared memory file.
191 //
192 // Though it shouldn't, it doesn't matter if this fails.
193 auto vfs = sqlite3_vfs_find("unix-excl");
194 if (vfs)
195 {
196 sqlite3_vfs_register(vfs, 1);
197 }
198 }
199#endif
200 }
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 201 of file ProjectFileIO.cpp.

202 {
203 // This function must be called single-threaded only
204 // It returns a value, but there's nothing we can do with it
205 (void) sqlite3_shutdown();
206 }

Member Function Documentation

◆ LogCallback()

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

Definition at line 208 of file ProjectFileIO.cpp.

209 {
210 wxLogMessage("sqlite3 message: (%d) %s", code, msg);
211 }

Referenced by SQLiteIniter().

Here is the caller graph for this function:

Member Data Documentation

◆ mRc

int SQLiteIniter::mRc

Definition at line 213 of file ProjectFileIO.cpp.

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


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