From 2effe9775db423d61d8a2bdd15c40e6015bac6f5 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Fri, 19 Aug 2022 17:34:12 +0200 Subject: Apply C++11 fixits modernize-loop-convert modernize-deprecated-headers --- src/dal/recordset.cpp | 21 +++++---------------- src/dal/sqlitedataprovider.cpp | 2 +- 2 files changed, 6 insertions(+), 17 deletions(-) (limited to 'src/dal') diff --git a/src/dal/recordset.cpp b/src/dal/recordset.cpp index 49c245cd..69104933 100644 --- a/src/dal/recordset.cpp +++ b/src/dal/recordset.cpp @@ -161,27 +161,16 @@ std::ostream &operator<<(std::ostream &out, const RecordSet &rhs) // print the field names first. if (rhs.mHeaders.size() > 0) { out << "|"; - for (auto it = rhs.mHeaders.begin(); - it != rhs.mHeaders.end(); - ++it) - { - out << (*it) << "|"; - } + for (const auto &header : rhs.mHeaders) + out << header << "|"; out << std::endl << std::endl; } // and then print every line. - for (auto it = rhs.mRows.begin(); - it != rhs.mRows.end(); - ++it) - { + for (const auto &row : rhs.mRows) { out << "|"; - for (auto it2 = (*it).begin(); - it2 != (*it).end(); - ++it2) - { - out << (*it2) << "|"; - } + for (const auto &element : row) + out << element << "|"; out << std::endl; } diff --git a/src/dal/sqlitedataprovider.cpp b/src/dal/sqlitedataprovider.cpp index 4aa7eca0..787088d1 100644 --- a/src/dal/sqlitedataprovider.cpp +++ b/src/dal/sqlitedataprovider.cpp @@ -26,7 +26,7 @@ #include "utils/logger.h" #include -#include +#include // sqlite3_int64 is the preferred new datatype for 64-bit int values. // see: http://www.sqlite.org/capi3ref.html#sqlite3_int64 -- cgit v1.2.3-60-g2f50