From d22e2c896091c2e49c49756b8fc6d43cb2b9cd67 Mon Sep 17 00:00:00 2001 From: Jihoon Chung Date: Tue, 8 Oct 2013 23:04:02 +0900 Subject: [PATCH] Replace DPL::AutoPtr usage (Warp_iri.cpp) [Issue#] N/A [Problem] DPL::AutoPtr should replace to use standard library. [Cause] After C++11 is enabled, std::unique_ptr and std::shared_ptr is available. DPL::AutoPtr isn't necessary to exist in the DPL. [Solution] DPL::AutoPtr -> std::unique_ptr, std::shared_ptr - Warp_iri.cpp uses DPL::AutoPtr to create iri_struct by iri_parse and iri_destory. Replace usage to use std::unique_ptr. [SCMRequest] N/A Change-Id: Id4582f21e916661bd8c1d07ad1e5dd0e52b36823 --- modules/utils/src/warp_iri.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/modules/utils/src/warp_iri.cpp b/modules/utils/src/warp_iri.cpp index a08551f..bd8650a 100644 --- a/modules/utils/src/warp_iri.cpp +++ b/modules/utils/src/warp_iri.cpp @@ -20,11 +20,11 @@ */ #include #include +#include #include #include #include #include -#include #include #include #include @@ -49,13 +49,6 @@ const DPL::String SCHEMA_HTTPS = DPL::FromUTF8String("https"); const DPL::String SCHEMA_FTP = DPL::FromUTF8String("ftp"); } // namespace anonymous -// This will create AutoPtr deleter for iri_struct. -// Deleter must be in the same namespace as definition of AutoPtr. - -namespace DPL { -DECLARE_DELETER(iri_struct, iri_destroy) -} // namespace DPL - WarpIRI::WarpIRI() : m_domain(false), m_port(UNKNOWN_PORT), @@ -79,8 +72,7 @@ void WarpIRI::set(const char *p_iri, if (strcmp(p_iri, "*") == 0) { return; } - - DPL::AutoPtr iri(iri_parse(p_iri)); + std::unique_ptr iri(iri_parse(p_iri), iri_destroy); if (!iri.get()) { LogError("Error in iri_parse!"); -- 2.34.1