diff options
| author | 2025-01-16 01:57:37 -0500 | |
|---|---|---|
| committer | 2025-01-16 01:57:37 -0500 | |
| commit | 81a21e6ce040e7740de86340c8ea4dba30e69bc3 (patch) | |
| tree | 95fc1741b907d5ba6d029a42d80092cb7c056c5e /SQLiteStudio3/coreSQLiteStudio/db/dbsqlite3.cpp | |
| parent | 3565aad630864ecdbe53fdaa501ea708555b3c7c (diff) | |
New upstream version 3.4.13+dfsg.upstream/3.4.13+dfsgupstream
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/db/dbsqlite3.cpp')
| -rw-r--r-- | SQLiteStudio3/coreSQLiteStudio/db/dbsqlite3.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/db/dbsqlite3.cpp b/SQLiteStudio3/coreSQLiteStudio/db/dbsqlite3.cpp index 76ddd20..296b7d1 100644 --- a/SQLiteStudio3/coreSQLiteStudio/db/dbsqlite3.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/db/dbsqlite3.cpp @@ -15,6 +15,21 @@ bool DbSqlite3::complete(const QString& sql) return Sqlite3::complete(sql.toUtf8().constData()); } +bool DbSqlite3::isDbFile(const QString &path) +{ + QFile file(path); + if (!file.open(QIODevice::ReadOnly)) { + return false; + } + + QByteArray data = file.read(16); + file.close(); + if (data.size() < 16) + return false; + + return data == QByteArrayLiteral("SQLite format 3\000"); +} + Db* DbSqlite3::clone() const { return new DbSqlite3(name, path, connOptions); |
