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

Constructor & Destructor Documentation

◆ SQLiteIniter()

SQLiteIniter::SQLiteIniter ( )
inline

Definition at line 170 of file ProjectFileIO.cpp.

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

References LogCallback(), and mRc.

Here is the call graph for this function:

◆ ~SQLiteIniter()

SQLiteIniter::~SQLiteIniter ( )
inline

Definition at line 198 of file ProjectFileIO.cpp.

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

Member Function Documentation

◆ LogCallback()

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

Definition at line 205 of file ProjectFileIO.cpp.

206  {
207  wxLogMessage("sqlite3 message: (%d) %s", code, msg);
208  }

Referenced by SQLiteIniter().

Here is the caller graph for this function:

Member Data Documentation

◆ mRc

int SQLiteIniter::mRc

Definition at line 210 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:210
SQLiteIniter::LogCallback
static void LogCallback(void *WXUNUSED(arg), int code, const char *msg)
Definition: ProjectFileIO.cpp:205