diff Framework/MySQL/MySQLDatabase.cpp @ 157:275e14f57f1e

replacing deprecated std::auto_ptr by std::unique_ptr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 06 Jul 2020 12:45:58 +0200
parents 063aa53b5917
children 4d32c9c8d6c0
line wrap: on
line diff
--- a/Framework/MySQL/MySQLDatabase.cpp	Mon Jul 06 12:40:44 2020 +0200
+++ b/Framework/MySQL/MySQLDatabase.cpp	Mon Jul 06 12:45:58 2020 +0200
@@ -27,6 +27,7 @@
 #include "../Common/ImplicitTransaction.h"
 #include "../Common/Integer64Value.h"
 
+#include <Compatibility.h>  // For std::unique_ptr<>
 #include <Logging.h>
 #include <OrthancException.h>
 #include <Toolbox.h>
@@ -321,7 +322,7 @@
 
     {
       MySQLTransaction t(*this);
-      std::auto_ptr<IResult> result(t.Execute(statement, args));
+      std::unique_ptr<IResult> result(t.Execute(statement, args));
 
       success = (!result->IsDone() &&
                  result->GetField(0).GetType() == ValueType_Integer64 &&
@@ -382,7 +383,7 @@
     args.SetUtf8Value("database", parameters_.GetDatabase());
     args.SetUtf8Value("table", name);
 
-    std::auto_ptr<IResult> result(statement.Execute(transaction, args));
+    std::unique_ptr<IResult> result(statement.Execute(transaction, args));
     return (!result->IsDone() &&
             result->GetFieldsCount() == 1 &&
             result->GetField(0).GetType() == ValueType_Integer64 &&
@@ -412,7 +413,7 @@
     Dictionary args;
     args.SetUtf8Value("database", name);
 
-    std::auto_ptr<IResult> result(statement.Execute(transaction, args));
+    std::unique_ptr<IResult> result(statement.Execute(transaction, args));
     return (!result->IsDone() &&
             result->GetFieldsCount() == 1 &&
             result->GetField(0).GetType() == ValueType_Integer64 &&
@@ -442,7 +443,7 @@
     Dictionary args;
     args.SetUtf8Value("trigger", name);
 
-    std::auto_ptr<IResult> result(statement.Execute(transaction, args));
+    std::unique_ptr<IResult> result(statement.Execute(transaction, args));
     return (!result->IsDone() &&
             result->GetFieldsCount() == 1 &&
             result->GetField(0).GetType() == ValueType_Integer64 &&