summaryrefslogtreecommitdiff
path: root/libodbcpp/odbc-selectcommand.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2018-04-22 15:13:33 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2018-04-22 15:13:33 +0100
commitffd3c8e7dcf3bee3304d7c28d8102bf343b64c76 (patch)
tree78f3cc6ce79e1aad4da917865c4a2669aac90e93 /libodbcpp/odbc-selectcommand.cpp
parentMark potential fall-through (diff)
downloadlibdbpp-odbc-ffd3c8e7dcf3bee3304d7c28d8102bf343b64c76.tar.bz2
libdbpp-odbc-ffd3c8e7dcf3bee3304d7c28d8102bf343b64c76.tar.xz
libdbpp-odbc-ffd3c8e7dcf3bee3304d7c28d8102bf343b64c76.zip
Updates code largely in-keeping with updates to be C++17 in line with libadhocutil and libdbpp.
Diffstat (limited to 'libodbcpp/odbc-selectcommand.cpp')
-rw-r--r--libodbcpp/odbc-selectcommand.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/libodbcpp/odbc-selectcommand.cpp b/libodbcpp/odbc-selectcommand.cpp
index e33b3da..6b28a32 100644
--- a/libodbcpp/odbc-selectcommand.cpp
+++ b/libodbcpp/odbc-selectcommand.cpp
@@ -43,7 +43,7 @@ ODBC::SelectCommand::fetch(SQLSMALLINT orientation, SQLLEN offset)
if (SQL_SUCCEEDED(diagrc)) {
if (!strncmp((const char*)sqlstatus, "01004", 5)) {
for (Columns::iterator i = columns->begin(); i != columns->end(); ++i) {
- boost::dynamic_pointer_cast<Column>(*i)->resize();
+ std::dynamic_pointer_cast<Column>(*i)->resize();
}
return fetch(SQL_FETCH_RELATIVE, 0);
}
@@ -57,7 +57,7 @@ ODBC::SelectCommand::fetch(SQLSMALLINT orientation, SQLLEN offset)
{
bool resized = false;
for (Columns::iterator i = columns->begin(); i != columns->end(); ++i) {
- resized |= boost::dynamic_pointer_cast<Column>(*i)->resize();
+ resized |= std::dynamic_pointer_cast<Column>(*i)->resize();
}
if (resized) {
return fetch(SQL_FETCH_RELATIVE, 0);
@@ -97,13 +97,13 @@ ODBC::SelectCommand::execute()
case SQL_REAL:
case SQL_FLOAT:
case SQL_DOUBLE:
- ncol = insertColumn(DB::ColumnPtr(new FloatingPointColumn(this, colName, col)));
+ ncol = insertColumn(std::make_shared<FloatingPointColumn>(this, colName, col));
break;
case SQL_SMALLINT:
case SQL_INTEGER:
case SQL_TINYINT:
case SQL_BIGINT:
- ncol = insertColumn(DB::ColumnPtr(new SignedIntegerColumn(this, colName, col)));
+ ncol = insertColumn(std::make_shared<SignedIntegerColumn>(this, colName, col));
break;
case SQL_TYPE_TIME:
case SQL_INTERVAL_YEAR:
@@ -119,21 +119,21 @@ ODBC::SelectCommand::execute()
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE_TO_SECOND:
- ncol = insertColumn(DB::ColumnPtr(new IntervalColumn(this, colName, col)));
+ ncol = insertColumn(std::make_shared<IntervalColumn>(this, colName, col));
break;
case SQL_TIMESTAMP:
case SQL_DATETIME:
case SQL_TYPE_DATE:
case SQL_TYPE_TIMESTAMP:
- ncol = insertColumn(DB::ColumnPtr(new TimeStampColumn(this, colName, col)));
+ ncol = insertColumn(std::make_shared<TimeStampColumn>(this, colName, col));
break;
case SQL_UNKNOWN_TYPE:
throw DB::ColumnTypeNotSupported();
default:
- ncol = insertColumn(DB::ColumnPtr(new CharArrayColumn(this, colName, col, bindSize)));
+ ncol = insertColumn(std::make_shared<CharArrayColumn>(this, colName, col, bindSize));
break;
};
- boost::dynamic_pointer_cast<Column>(ncol)->bind();
+ std::dynamic_pointer_cast<Column>(ncol)->bind();
}
}