diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-07-30 09:36:55 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-07-30 09:36:55 (GMT) |
commit | 4ae47ae6f238d465eefa1b5a85c0cf3f7857bc57 (patch) | |
tree | 82d3a308c856cd7380fa8671bd2fe861d667bf7c /src/sqlite3gen.cpp | |
parent | d24fde41af551a2e6b2592e0b4084b6f449abf83 (diff) | |
download | Doxygen-4ae47ae6f238d465eefa1b5a85c0cf3f7857bc57.zip Doxygen-4ae47ae6f238d465eefa1b5a85c0cf3f7857bc57.tar.gz Doxygen-4ae47ae6f238d465eefa1b5a85c0cf3f7857bc57.tar.bz2 |
Added configuration options to better control the sqlite3 output.
Still requires cmake -Duse_sqlite=YES to compile in support (and
libsqlite3)
New configuration options available:
- GENERATE_SQLITE3 enable/disable SQLITE3 output
- SQLITE3_OUTPUT configure directory where output is written to
(default: sqlite3)
- SQLITE3_RECREATE_DB controls if existing database file is overwritten
(default: YES)
Diffstat (limited to 'src/sqlite3gen.cpp')
-rw-r--r-- | src/sqlite3gen.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/sqlite3gen.cpp b/src/sqlite3gen.cpp index 77aab68..2f72221 100644 --- a/src/sqlite3gen.cpp +++ b/src/sqlite3gen.cpp @@ -2503,11 +2503,10 @@ static void generateSqlite3ForPage(const PageDef *pd,bool isExample) static sqlite3* openDbConnection() { - QCString outputDirectory = Config_getString(OUTPUT_DIRECTORY); + QCString outputDirectory = Config_getString(SQLITE3_OUTPUT); QDir sqlite3Dir(outputDirectory); sqlite3 *db; int rc; - struct stat buf; rc = sqlite3_initialize(); if (rc != SQLITE_OK) @@ -2516,15 +2515,24 @@ static sqlite3* openDbConnection() return NULL; } + QCString dbFileName = "doxygen_sqlite3.db"; + QFileInfo fi(outputDirectory+"/"+dbFileName); - if (stat (outputDirectory+"/doxygen_sqlite3.db", &buf) == 0) + if (fi.exists()) { - err("doxygen_sqlite3.db already exists! Rename, remove, or archive it to regenerate\n"); - return NULL; + if (Config_getBool(SQLITE3_RECREATE_DB)) + { + QDir().remove(fi.absFilePath()); + } + else + { + err("doxygen_sqlite3.db already exists! Rename, remove, or archive it to regenerate\n"); + return NULL; + } } rc = sqlite3_open_v2( - outputDirectory+"/doxygen_sqlite3.db", + fi.absFilePath().utf8(), &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0 |