From 36d1ebb68359d7faa194a1f62c17011b462a3a1f Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 4 Feb 2019 16:56:59 +0000 Subject: Switch to string_view --- libpqpp/pq-column.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'libpqpp/pq-column.cpp') diff --git a/libpqpp/pq-column.cpp b/libpqpp/pq-column.cpp index 6dbbfd2..5e02015 100644 --- a/libpqpp/pq-column.cpp +++ b/libpqpp/pq-column.cpp @@ -25,7 +25,7 @@ PQ::Column::isNull() const return PQgetisnull(sc->execRes, sc->tuple, colNo); } -int +std::size_t PQ::Column::length() const { return PQgetlength(sc->execRes, sc->tuple, colNo); @@ -49,7 +49,8 @@ PQ::Column::apply(DB::HandleField & h) const case 1043: //VARCHAROID: case 25: //TEXTOID: case 142: //XMLOID: - h.string(value(), length()); + default: + h.string({ value(), length() }); break; case 16: //BOOLOID: h.boolean(value()[0] == 't'); @@ -97,8 +98,6 @@ PQ::Column::apply(DB::HandleField & h) const h.blob(DB::Blob(buf, len)); break; } - default: - h.string(value(), length()); } } -- cgit v1.2.3