finally get rid of std::auto_ptr

This commit is contained in:
Günter Obiltschnig
2019-12-15 09:40:40 +01:00
parent 56fe4eaf97
commit 9c197e0ed1
19 changed files with 85 additions and 229 deletions

View File

@@ -50,7 +50,7 @@ public:
{
Poco::Net::initializeSSL();
}
~SSLInitializer()
{
Poco::Net::uninitializeSSL();
@@ -64,7 +64,7 @@ int main(int argc, char** argv)
HTTPStreamFactory::registerFactory();
HTTPSStreamFactory::registerFactory();
FTPStreamFactory::registerFactory();
if (argc != 2)
{
Path p(argv[0]);
@@ -74,7 +74,7 @@ int main(int argc, char** argv)
return 1;
}
// Note: we must create the passphrase handler prior Context
// Note: we must create the passphrase handler prior Context
SharedPtr<InvalidCertificateHandler> ptrCert = new ConsoleCertificateHandler(false); // ask the user via console
Context::Ptr ptrContext = new Context(Context::CLIENT_USE, "", "", "rootcert.pem", Context::VERIFY_RELAXED, 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
SSLManager::instance().initializeClient(0, ptrCert, ptrContext);
@@ -82,11 +82,7 @@ int main(int argc, char** argv)
try
{
URI uri(argv[1]);
#ifndef POCO_ENABLE_CPP11
std::auto_ptr<std::istream> pStr(URIStreamOpener::defaultOpener().open(uri));
#else
std::unique_ptr<std::istream> pStr(URIStreamOpener::defaultOpener().open(uri));
#endif
StreamCopier::copyStream(*pStr.get(), std::cout);
}
catch (Exception& exc)
@@ -94,6 +90,6 @@ int main(int argc, char** argv)
std::cerr << exc.displayText() << std::endl;
return 1;
}
return 0;
}