X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fsubtitle_analysis.cc;h=9b3ae86c065656ad71394e0b01575ed30f2af4e1;hb=ff639b3cf30afcc097bfd21d39c8d15f466cadd6;hp=28eedac0d84d7fba2a780a20e69f282bf292dd8c;hpb=3680fe0cf714f1bf47b5b6d348813ebb1cdd50f2;p=dcpomatic.git diff --git a/src/lib/subtitle_analysis.cc b/src/lib/subtitle_analysis.cc index 28eedac0d..9b3ae86c0 100644 --- a/src/lib/subtitle_analysis.cc +++ b/src/lib/subtitle_analysis.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2020 Carl Hetherington + Copyright (C) 2020-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,18 +18,22 @@ */ + #include "subtitle_analysis.h" #include "exceptions.h" -#include "warnings.h" #include #include -DCPOMATIC_DISABLE_WARNINGS +#include +LIBDCP_DISABLE_WARNINGS #include -DCPOMATIC_ENABLE_WARNINGS +LIBDCP_ENABLE_WARNINGS + +using std::make_shared; +using std::shared_ptr; using std::string; using dcp::raw_convert; -using boost::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 doc (new xmlpp::Document); + auto doc = make_shared(); xmlpp::Element* root = doc->create_root_node ("SubtitleAnalysis"); root->add_child("Version")->add_child_text (raw_convert(_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(_bounding_box->x)); bounding_box->add_child("Y")->add_child_text(raw_convert(_bounding_box->y)); bounding_box->add_child("Width")->add_child_text(raw_convert(_bounding_box->width)); @@ -81,4 +85,3 @@ SubtitleAnalysis::write (boost::filesystem::path path) const doc->write_to_file_formatted (path.string()); } -