diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-12-20 14:11:13 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-01-05 02:09:49 +0100 |
| commit | 47727a7c80b60a0fd0ce18d8347b14241fc48f97 (patch) | |
| tree | e1137ad3c8dc58ef5017011cdcc89a378b223092 /src | |
| parent | 64eb1161584a9813591cf958fbc2fa0208d58ce8 (diff) | |
std::shared_ptr
Diffstat (limited to 'src')
| -rw-r--r-- | src/dcp_reader.cc | 4 | ||||
| -rw-r--r-- | src/reader_factory.cc | 2 | ||||
| -rw-r--r-- | src/reader_factory.h | 4 | ||||
| -rw-r--r-- | src/stl_binary_reader.cc | 2 | ||||
| -rw-r--r-- | src/stl_binary_reader.h | 2 | ||||
| -rw-r--r-- | src/util.cc | 4 | ||||
| -rw-r--r-- | src/util.h | 4 | ||||
| -rw-r--r-- | src/xml.h | 38 |
8 files changed, 30 insertions, 30 deletions
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<Reader> 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 <boost/shared_ptr.hpp> +#include <memory> #include <boost/filesystem.hpp> namespace sub { class Reader; -extern boost::shared_ptr<Reader> +extern std::shared_ptr<Reader> 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<InputReader> reader); + void read (std::shared_ptr<InputReader> 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 <boost/shared_ptr.hpp> +#include <memory> #include <string> #include <iostream> #include <cstdio> @@ -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. @@ -22,7 +22,7 @@ */ #include <boost/optional.hpp> -#include <boost/shared_ptr.hpp> +#include <memory> #include <string> #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<std::string>& line); extern boost::optional<std::string> get_line_file (FILE* f); extern boost::optional<std::string> get_line_string (std::string* s); -extern void dump (boost::shared_ptr<const Reader> read, std::ostream& os); +extern void dump (std::shared_ptr<const Reader> read, std::ostream& os); } @@ -31,61 +31,61 @@ namespace sub { template <class T> -boost::shared_ptr<T> +std::shared_ptr<T> optional_type_child (cxml::Node const & node, std::string name) { - std::list<boost::shared_ptr<cxml::Node> > n = node.node_children (name); + std::list<std::shared_ptr<cxml::Node> > n = node.node_children (name); if (n.size() > 1) { throw XMLError ("duplicate XML tag"); } else if (n.empty ()) { - return boost::shared_ptr<T> (); + return std::shared_ptr<T> (); } - return boost::shared_ptr<T> (new T (n.front ())); + return std::shared_ptr<T> (new T (n.front ())); } template <class T> -boost::shared_ptr<T> type_child (boost::shared_ptr<const cxml::Node> node, std::string name) { - return boost::shared_ptr<T> (new T (node->node_child (name))); +std::shared_ptr<T> type_child (std::shared_ptr<const cxml::Node> node, std::string name) { + return std::shared_ptr<T> (new T (node->node_child (name))); } template <class T> -boost::shared_ptr<T> -optional_type_child (boost::shared_ptr<const cxml::Node> node, std::string name) +std::shared_ptr<T> +optional_type_child (std::shared_ptr<const cxml::Node> node, std::string name) { return optional_type_child<T> (*node.get(), name); } template <class T> -std::list<boost::shared_ptr<T> > +std::list<std::shared_ptr<T> > type_children (cxml::Node const & node, std::string name) { - std::list<boost::shared_ptr<cxml::Node> > n = node.node_children (name); - std::list<boost::shared_ptr<T> > r; - for (typename std::list<boost::shared_ptr<cxml::Node> >::iterator i = n.begin(); i != n.end(); ++i) { - r.push_back (boost::shared_ptr<T> (new T (*i))); + std::list<std::shared_ptr<cxml::Node> > n = node.node_children (name); + std::list<std::shared_ptr<T> > r; + for (typename std::list<std::shared_ptr<cxml::Node> >::iterator i = n.begin(); i != n.end(); ++i) { + r.push_back (std::shared_ptr<T> (new T (*i))); } return r; } template <class T> -std::list<boost::shared_ptr<T> > -type_children (boost::shared_ptr<const cxml::Node> node, std::string name) +std::list<std::shared_ptr<T> > +type_children (std::shared_ptr<const cxml::Node> node, std::string name) { return type_children<T> (*node.get(), name); } template <class T> -std::list<boost::shared_ptr<T> > +std::list<std::shared_ptr<T> > type_grand_children (cxml::Node const & node, std::string name, std::string sub) { - boost::shared_ptr<const cxml::Node> p = node.node_child (name); + std::shared_ptr<const cxml::Node> p = node.node_child (name); return type_children<T> (p, sub); } template <class T> -std::list<boost::shared_ptr<T> > -type_grand_children (boost::shared_ptr<const cxml::Node> node, std::string name, std::string sub) +std::list<std::shared_ptr<T> > +type_grand_children (std::shared_ptr<const cxml::Node> node, std::string name, std::string sub) { return type_grand_children<T> (*node.get(), name, sub); } |
