diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-04-08 21:32:44 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-04-08 21:32:44 +0200 |
| commit | 3339d3bce70afe9ae2ca10e9fcfc4b54b748fbf4 (patch) | |
| tree | 9cac355432ba25cc3d43017382d73e0640f50996 /src/lib/subtitle_analysis.cc | |
| parent | 00762c2d9a4240d016150cd7555aee3dad8542ae (diff) | |
Assorted C++11/formatting cleanups.
Diffstat (limited to 'src/lib/subtitle_analysis.cc')
| -rw-r--r-- | src/lib/subtitle_analysis.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/lib/subtitle_analysis.cc b/src/lib/subtitle_analysis.cc index 49041151f..0838816b0 100644 --- a/src/lib/subtitle_analysis.cc +++ b/src/lib/subtitle_analysis.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2020 Carl Hetherington <cth@carlh.net> + Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -18,6 +18,7 @@ */ + #include "subtitle_analysis.h" #include "exceptions.h" #include "warnings.h" @@ -27,9 +28,12 @@ DCPOMATIC_DISABLE_WARNINGS #include <libxml++/libxml++.h> DCPOMATIC_ENABLE_WARNINGS + +using std::make_shared; +using std::shared_ptr; using std::string; using dcp::raw_convert; -using std::shared_ptr; + int const SubtitleAnalysis::_current_state_version = 1; @@ -62,13 +66,13 @@ SubtitleAnalysis::SubtitleAnalysis (boost::filesystem::path path) void SubtitleAnalysis::write (boost::filesystem::path path) const { - shared_ptr<xmlpp::Document> doc (new xmlpp::Document); + auto doc = make_shared<xmlpp::Document>(); xmlpp::Element* root = doc->create_root_node ("SubtitleAnalysis"); root->add_child("Version")->add_child_text (raw_convert<string>(_current_state_version)); if (_bounding_box) { - xmlpp::Element* bounding_box = root->add_child("BoundingBox"); + auto bounding_box = root->add_child("BoundingBox"); bounding_box->add_child("X")->add_child_text(raw_convert<string>(_bounding_box->x)); bounding_box->add_child("Y")->add_child_text(raw_convert<string>(_bounding_box->y)); bounding_box->add_child("Width")->add_child_text(raw_convert<string>(_bounding_box->width)); @@ -81,4 +85,3 @@ SubtitleAnalysis::write (boost::filesystem::path path) const doc->write_to_file_formatted (path.string()); } - |
