summaryrefslogtreecommitdiff
path: root/libpqpp/pq-column.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-02-04 16:56:59 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2019-02-04 16:56:59 +0000
commit36d1ebb68359d7faa194a1f62c17011b462a3a1f (patch)
tree264111badc785108c3cd2806d3db0f790e8e31a6 /libpqpp/pq-column.cpp
parentRemove unnecessary calls to .string() (diff)
downloadlibdbpp-postgresql-36d1ebb68359d7faa194a1f62c17011b462a3a1f.tar.bz2
libdbpp-postgresql-36d1ebb68359d7faa194a1f62c17011b462a3a1f.tar.xz
libdbpp-postgresql-36d1ebb68359d7faa194a1f62c17011b462a3a1f.zip
Switch to string_view
Diffstat (limited to 'libpqpp/pq-column.cpp')
-rw-r--r--libpqpp/pq-column.cpp7
1 files changed, 3 insertions, 4 deletions
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());
}
}