summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-02-10 12:17:00 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2019-02-10 12:17:00 +0000
commitae7b868697227abf55c668e796a8f030571aebdb (patch)
treec92ddd9885ca73460c119b6fab500b3c0022ba83
parentRemove boost::filesystem in favour of std::filesystem (diff)
downloadproject2-ae7b868697227abf55c668e796a8f030571aebdb.tar.bz2
project2-ae7b868697227abf55c668e796a8f030571aebdb.tar.xz
project2-ae7b868697227abf55c668e796a8f030571aebdb.zip
Switch to string_view for libdbpp compat
-rw-r--r--project2/sql/sqlHandleAsVariableType.cpp4
-rw-r--r--project2/sql/sqlHandleAsVariableType.h2
-rw-r--r--project2/sql/sqlTest.cpp4
3 files changed, 5 insertions, 5 deletions
diff --git a/project2/sql/sqlHandleAsVariableType.cpp b/project2/sql/sqlHandleAsVariableType.cpp
index ac1ea3b..a692a40 100644
--- a/project2/sql/sqlHandleAsVariableType.cpp
+++ b/project2/sql/sqlHandleAsVariableType.cpp
@@ -5,8 +5,8 @@
void HandleAsVariableType::null() {
variable = Null();
}
-void HandleAsVariableType::string(const char * c, size_t l) {
- variable = Glib::ustring(c, c + l);
+void HandleAsVariableType::string(const std::string_view s) {
+ variable = Glib::ustring(s.begin(), s.end());
}
void HandleAsVariableType::integer(int64_t i) {
variable = i;
diff --git a/project2/sql/sqlHandleAsVariableType.h b/project2/sql/sqlHandleAsVariableType.h
index 97b63c9..5bf38c3 100644
--- a/project2/sql/sqlHandleAsVariableType.h
+++ b/project2/sql/sqlHandleAsVariableType.h
@@ -7,7 +7,7 @@
class DLL_PUBLIC HandleAsVariableType : public DB::HandleField {
public:
void null();
- void string(const char * c, size_t l);
+ void string(const std::string_view l);
void integer(int64_t i);
void boolean(bool i);
void floatingpoint(double d);
diff --git a/project2/sql/sqlTest.cpp b/project2/sql/sqlTest.cpp
index 1bb6678..1eac20e 100644
--- a/project2/sql/sqlTest.cpp
+++ b/project2/sql/sqlTest.cpp
@@ -37,8 +37,8 @@ class HandleDoCompare : public DB::HandleField {
void null() {
throw CantCompareNulls();
}
- void string(const char *c , size_t l) {
- doTest(Glib::ustring(c, c + l));
+ void string(const std::string_view s) {
+ doTest(Glib::ustring(s.begin(), s.end()));
}
void integer(int64_t val) {
doTest(val);