From 47727a7c80b60a0fd0ce18d8347b14241fc48f97 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 20 Dec 2020 14:11:13 +0100 Subject: std::shared_ptr --- src/dcp_reader.cc | 4 ++-- src/reader_factory.cc | 2 +- src/reader_factory.h | 4 ++-- src/stl_binary_reader.cc | 2 +- src/stl_binary_reader.h | 2 +- src/util.cc | 4 ++-- src/util.h | 4 ++-- src/xml.h | 38 +++++++++++++++++++------------------- 8 files changed, 30 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/dcp_reader.cc b/src/dcp_reader.cc index a3ee8e5..5784ad0 100644 --- a/src/dcp_reader.cc +++ b/src/dcp_reader.cc @@ -30,9 +30,9 @@ using std::list; using std::cout; using std::string; using std::exception; -using boost::shared_ptr; +using std::shared_ptr; using boost::optional; -using boost::dynamic_pointer_cast; +using std::dynamic_pointer_cast; using namespace sub; static Time diff --git a/src/reader_factory.cc b/src/reader_factory.cc index 759abff..fb717ea 100644 --- a/src/reader_factory.cc +++ b/src/reader_factory.cc @@ -30,7 +30,7 @@ using std::string; using std::ifstream; using boost::algorithm::ends_with; -using boost::shared_ptr; +using std::shared_ptr; using namespace sub; shared_ptr diff --git a/src/reader_factory.h b/src/reader_factory.h index e7c349b..e519468 100644 --- a/src/reader_factory.h +++ b/src/reader_factory.h @@ -17,14 +17,14 @@ */ -#include +#include #include namespace sub { class Reader; -extern boost::shared_ptr +extern std::shared_ptr reader_factory (boost::filesystem::path); } diff --git a/src/stl_binary_reader.cc b/src/stl_binary_reader.cc index 467830c..f441aec 100644 --- a/src/stl_binary_reader.cc +++ b/src/stl_binary_reader.cc @@ -36,7 +36,7 @@ using boost::lexical_cast; using boost::algorithm::replace_all; using boost::is_any_of; using boost::locale::conv::utf_to_utf; -using boost::shared_ptr; +using std::shared_ptr; using namespace sub; namespace sub { diff --git a/src/stl_binary_reader.h b/src/stl_binary_reader.h index fd85a3c..94d68b3 100644 --- a/src/stl_binary_reader.h +++ b/src/stl_binary_reader.h @@ -70,7 +70,7 @@ public: std::string editor_contact_details; private: - void read (boost::shared_ptr reader); + void read (std::shared_ptr reader); STLBinaryTables _tables; }; diff --git a/src/util.cc b/src/util.cc index 89af13f..c347375 100644 --- a/src/util.cc +++ b/src/util.cc @@ -21,7 +21,7 @@ #include "reader.h" #include "subtitle.h" #include "collect.h" -#include +#include #include #include #include @@ -33,7 +33,7 @@ using std::ostream; using std::map; using std::list; using boost::optional; -using boost::shared_ptr; +using std::shared_ptr; using namespace sub; /** @param s A string. diff --git a/src/util.h b/src/util.h index fbf0fa6..28da387 100644 --- a/src/util.h +++ b/src/util.h @@ -22,7 +22,7 @@ */ #include -#include +#include #include #define LIBSUB_UNUSED(x) (void)(x) @@ -35,6 +35,6 @@ extern bool empty_or_white_space (std::string s); extern void remove_unicode_bom (boost::optional& line); extern boost::optional get_line_file (FILE* f); extern boost::optional get_line_string (std::string* s); -extern void dump (boost::shared_ptr read, std::ostream& os); +extern void dump (std::shared_ptr read, std::ostream& os); } diff --git a/src/xml.h b/src/xml.h index d07188f..bf1477b 100644 --- a/src/xml.h +++ b/src/xml.h @@ -31,61 +31,61 @@ namespace sub { template -boost::shared_ptr +std::shared_ptr optional_type_child (cxml::Node const & node, std::string name) { - std::list > n = node.node_children (name); + std::list > n = node.node_children (name); if (n.size() > 1) { throw XMLError ("duplicate XML tag"); } else if (n.empty ()) { - return boost::shared_ptr (); + return std::shared_ptr (); } - return boost::shared_ptr (new T (n.front ())); + return std::shared_ptr (new T (n.front ())); } template -boost::shared_ptr type_child (boost::shared_ptr node, std::string name) { - return boost::shared_ptr (new T (node->node_child (name))); +std::shared_ptr type_child (std::shared_ptr node, std::string name) { + return std::shared_ptr (new T (node->node_child (name))); } template -boost::shared_ptr -optional_type_child (boost::shared_ptr node, std::string name) +std::shared_ptr +optional_type_child (std::shared_ptr node, std::string name) { return optional_type_child (*node.get(), name); } template -std::list > +std::list > type_children (cxml::Node const & node, std::string name) { - std::list > n = node.node_children (name); - std::list > r; - for (typename std::list >::iterator i = n.begin(); i != n.end(); ++i) { - r.push_back (boost::shared_ptr (new T (*i))); + std::list > n = node.node_children (name); + std::list > r; + for (typename std::list >::iterator i = n.begin(); i != n.end(); ++i) { + r.push_back (std::shared_ptr (new T (*i))); } return r; } template -std::list > -type_children (boost::shared_ptr node, std::string name) +std::list > +type_children (std::shared_ptr node, std::string name) { return type_children (*node.get(), name); } template -std::list > +std::list > type_grand_children (cxml::Node const & node, std::string name, std::string sub) { - boost::shared_ptr p = node.node_child (name); + std::shared_ptr p = node.node_child (name); return type_children (p, sub); } template -std::list > -type_grand_children (boost::shared_ptr node, std::string name, std::string sub) +std::list > +type_grand_children (std::shared_ptr node, std::string name, std::string sub) { return type_grand_children (*node.get(), name, sub); } -- cgit v1.2.3