@@ -313,7 +313,7 @@ class Database
313
313
}
314
314
315
315
/* *
316
- * @brief Create or redefine a SQL function or aggregate in the sqlite database.
316
+ * @brief Create or redefine a SQL function or aggregate in the sqlite database.
317
317
*
318
318
* This is the equivalent of the sqlite3_create_function_v2 command.
319
319
* @see http://www.sqlite.org/c3ref/create_function.html
@@ -341,7 +341,7 @@ class Database
341
341
void (*apDestroy)(void *));
342
342
343
343
/* *
344
- * @brief Create or redefine a SQL function or aggregate in the sqlite database.
344
+ * @brief Create or redefine a SQL function or aggregate in the sqlite database.
345
345
*
346
346
* This is the equivalent of the sqlite3_create_function_v2 command.
347
347
* @see http://www.sqlite.org/c3ref/create_function.html
@@ -373,7 +373,7 @@ class Database
373
373
}
374
374
375
375
/* *
376
- * @brief Load a module into the current sqlite database instance.
376
+ * @brief Load a module into the current sqlite database instance.
377
377
*
378
378
* This is the equivalent of the sqlite3_load_extension call, but additionally enables
379
379
* module loading support prior to loading the requested module.
@@ -392,8 +392,8 @@ class Database
392
392
/* *
393
393
* @brief Set the key for the current sqlite database instance.
394
394
*
395
- * This is the equivalent of the sqlite3_key call and should thus be called
396
- * directly after opening the database.
395
+ * This is the equivalent of the sqlite3_key call and should thus be called
396
+ * directly after opening the database.
397
397
* Open encrypted database -> call db.key("secret") -> database ready
398
398
*
399
399
* @param[in] aKey Key to decode/encode the database
@@ -421,10 +421,10 @@ class Database
421
421
/* *
422
422
* @brief Test if a file contains an unencrypted database.
423
423
*
424
- * This is a simple test that reads the first bytes of a database file and
425
- * compares them to the standard header for unencrypted databases. If the
426
- * header does not match the standard string, we assume that we have an
427
- * encrypted file.
424
+ * This is a simple test that reads the first bytes of a database file and
425
+ * compares them to the standard header for unencrypted databases. If the
426
+ * header does not match the standard string, we assume that we have an
427
+ * encrypted file.
428
428
*
429
429
* @param[in] aFilename path/uri to a file
430
430
*
@@ -434,6 +434,18 @@ class Database
434
434
*/
435
435
static bool isUnencrypted (const std::string& aFilename);
436
436
437
+ /* *
438
+ * @brief Load or save the database content.
439
+ *
440
+ * This function is used to load the contents of a database file on disk
441
+ * into the "main" database of open database connection, or to save the current
442
+ * contents of the database into a database file on disk.
443
+ *
444
+ * @return SQLITE_OK on success or an error code from SQLite.
445
+ */
446
+ enum class BackupType { Save, Load };
447
+ int backup (const char * zFilename, BackupType type);
448
+
437
449
private:
438
450
// / @{ Database must be non-copyable
439
451
Database (const Database&);
0 commit comments