From 5e90d90ac629a227e63c9b65f133316a05c4d48f Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Fri, 3 May 2019 15:06:48 +0200 Subject: [PATCH] Replace all typedefs by usings This is just a matter of code style, no functional change whatsoever. --- src/RowCache.h | 2 +- src/RowLoader.h | 2 +- src/csvparser.h | 2 +- src/sqlitedb.h | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/RowCache.h b/src/RowCache.h index b0348fcd..182c9865 100644 --- a/src/RowCache.h +++ b/src/RowCache.h @@ -27,7 +27,7 @@ template class RowCache { public: - typedef T value_type; + using value_type = T; /// constructs an empty cache explicit RowCache (); diff --git a/src/RowLoader.h b/src/RowLoader.h index 4dd7e194..9e4feca7 100644 --- a/src/RowLoader.h +++ b/src/RowLoader.h @@ -24,7 +24,7 @@ class RowLoader : public QThread void run() override; public: - typedef RowCache> Cache; + using Cache = RowCache>; /// set up worker thread to handle row loading explicit RowLoader ( diff --git a/src/csvparser.h b/src/csvparser.h index 38d3a44b..e177605a 100644 --- a/src/csvparser.h +++ b/src/csvparser.h @@ -50,7 +50,7 @@ struct CSVRow class CSVParser { public: - typedef std::function csvRowFunction; + using csvRowFunction = std::function; CSVParser(bool trimfields = true, char fieldseparator = ',', char quotechar = '"'); ~CSVParser(); diff --git a/src/sqlitedb.h b/src/sqlitedb.h index 1d7b7985..b98fc52d 100644 --- a/src/sqlitedb.h +++ b/src/sqlitedb.h @@ -25,8 +25,8 @@ enum LogMessageType kLogMsg_ErrorLog }; -typedef QMultiMap objectMap; // Maps from object type (table, index, view, trigger) to a pointer to the object representation -typedef QMap schemaMap; // Maps from the schema name (main, temp, attached schemas) to the object map for that schema +using objectMap = QMultiMap; // Maps from object type (table, index, view, trigger) to a pointer to the object representation +using schemaMap = QMap; // Maps from the schema name (main, temp, attached schemas) to the object map for that schema int collCompare(void* pArg, int sizeA, const void* sA, int sizeB, const void* sB); @@ -76,7 +76,7 @@ public: // This returns the SQLite version as well as the SQLCipher if DB4S is compiled with encryption support static void getSqliteVersion(QString& sqlite, QString& sqlcipher); - typedef std::unique_ptr db_pointer_type; + using db_pointer_type = std::unique_ptr; /** borrow exclusive address to the currently open database, until @@ -124,7 +124,7 @@ public: // callback is the text representation of the values, one for each // column. The 3rd argument is a list of strings where each entry // represents the name of corresponding result column. - typedef std::function execCallback; + using execCallback = std::function; bool executeSQL(QString statement, bool dirtyDB = true, bool logsql = true, execCallback callback = nullptr); bool executeMultiSQL(QByteArray query, bool dirty = true, bool log = false); QByteArray querySingleValueFromDb(const QString& sql, bool log = true, ChoiceOnUse choice = Ask);