Audacity  3.0.3
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 164 of file ProjectFileIO.cpp.

Constructor & Destructor Documentation

◆ SQLiteIniter()

SQLiteIniter::SQLiteIniter ( )
inline

Definition at line 167 of file ProjectFileIO.cpp.

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

References LogCallback(), and mRc.

Here is the call graph for this function:

◆ ~SQLiteIniter()

SQLiteIniter::~SQLiteIniter ( )
inline

Definition at line 195 of file ProjectFileIO.cpp.

196  {
197  // This function must be called single-threaded only
198  // It returns a value, but there's nothing we can do with it
199  (void) sqlite3_shutdown();
200  }

Member Function Documentation

◆ LogCallback()

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

Definition at line 202 of file ProjectFileIO.cpp.

203  {
204  wxLogMessage("sqlite3 message: (%d) %s", code, msg);
205  }

Referenced by SQLiteIniter().

Here is the caller graph for this function:

Member Data Documentation

◆ mRc

int SQLiteIniter::mRc

Definition at line 207 of file ProjectFileIO.cpp.

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


The documentation for this class was generated from the following file:
SQLiteIniter::mRc
int mRc
Definition: ProjectFileIO.cpp:207
SQLiteIniter::LogCallback
static void LogCallback(void *WXUNUSED(arg), int code, const char *msg)
Definition: ProjectFileIO.cpp:202