X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcross_common.cc;h=2e48bf3e015131fab22094fea7a46b80f028325f;hb=9a97c1b4116d7fb80e8ab145c0cc738dbf14d617;hp=edc806b584fed235a947e53a46751725bac7424c;hpb=2da4caba7871455c097c0ed940dd6f2332dbda5d;p=dcpomatic.git diff --git a/src/lib/cross_common.cc b/src/lib/cross_common.cc index edc806b58..2e48bf3e0 100644 --- a/src/lib/cross_common.cc +++ b/src/lib/cross_common.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2020 Carl Hetherington + Copyright (C) 2012-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,12 +18,12 @@ */ + #include "cross.h" #include "compose.hpp" #include "dcpomatic_log.h" #include "warnings.h" #include -#include DCPOMATIC_DISABLE_WARNINGS #include DCPOMATIC_ENABLE_WARNINGS @@ -31,14 +31,16 @@ DCPOMATIC_ENABLE_WARNINGS #include "i18n.h" + using std::string; + Drive::Drive (string xml) { cxml::Document doc; doc.read_string (xml); _device = doc.string_child("Device"); - BOOST_FOREACH (cxml::ConstNodePtr i, doc.node_children("MountPoint")) { + for (auto i: doc.node_children("MountPoint")) { _mount_points.push_back (i->content()); } _size = doc.number_child("Size"); @@ -51,9 +53,9 @@ string Drive::as_xml () const { xmlpp::Document doc; - xmlpp::Element* root = doc.create_root_node ("Drive"); + auto root = doc.create_root_node ("Drive"); root->add_child("Device")->add_child_text(_device); - BOOST_FOREACH (boost::filesystem::path i, _mount_points) { + for (auto i: _mount_points) { root->add_child("MountPoint")->add_child_text(i.string()); } root->add_child("Size")->add_child_text(dcp::raw_convert(_size)); @@ -92,11 +94,12 @@ Drive::description () const return String::compose(_("%1 (%2 GB) [%3]"), name, gb, _device); } + string Drive::log_summary () const { string mp; - BOOST_FOREACH (boost::filesystem::path i, _mount_points) { + for (auto i: _mount_points) { mp += i.string() + ","; } if (mp.empty()) {