summaryrefslogtreecommitdiff
path: root/libodbcpp/odbc-param.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libodbcpp/odbc-param.cpp')
-rw-r--r--libodbcpp/odbc-param.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/libodbcpp/odbc-param.cpp b/libodbcpp/odbc-param.cpp
index f165d60..120703e 100644
--- a/libodbcpp/odbc-param.cpp
+++ b/libodbcpp/odbc-param.cpp
@@ -74,7 +74,8 @@ SIMPLEBINDER(bool, BooleanParam, B);
SIMPLEBINDER(double, FloatingPointParam, F);
SIMPLEBINDER(float, FloatingPointParam, F);
-SIMPLEBINDER(const Glib::ustring &, GlibUstringParam, S);
+SIMPLEBINDER(const Glib::ustring &, StdStringParam, S);
+SIMPLEBINDER(const std::string_view &, StdStringParam, S);
SIMPLEBINDER(const boost::posix_time::ptime &, TimeStampParam, T);
SIMPLEBINDER(const boost::posix_time::time_duration &, IntervalParam, T);
@@ -86,7 +87,7 @@ ODBC::Command::bindNull(unsigned int i)
}
void
-ODBC::GlibUstringParam::operator=(Glib::ustring const & d)
+ODBC::StdStringParam::operator=(Glib::ustring const & d)
{
const char * addr = data.data();
data = d;
@@ -99,6 +100,19 @@ ODBC::GlibUstringParam::operator=(Glib::ustring const & d)
}
void
+ODBC::StdStringParam::operator=(std::string_view const & d)
+{
+ const char * addr = data.data();
+ data = d;
+ bindLen = d.length();
+ paramBound &= (addr == data.data());
+ if (!paramBound) {
+ paramBound = false;
+ bind();
+ }
+}
+
+void
ODBC::TimeStampParam::operator=(const boost::posix_time::ptime & d)
{
data.year = d.date().year();