From c272879a8e748be83acbb190257d78a34be3f25f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 28 May 2014 15:56:49 +0100 Subject: Add CPL::filename(). --- src/cpl.cc | 12 +++++++----- src/cpl.h | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/cpl.cc b/src/cpl.cc index 5079b4f6..1ac0621b 100644 --- a/src/cpl.cc +++ b/src/cpl.cc @@ -191,14 +191,16 @@ CPL::add_reel (shared_ptr reel) _reels.push_back (reel); } +boost::filesystem::path +CPL::filename () const +{ + return _directory / String::compose ("%1_cpl.xml", _id); +} + void CPL::write_xml (bool interop, XMLMetadata const & metadata, shared_ptr signer) const { - boost::filesystem::path p; - p /= _directory; - stringstream s; - s << _id << "_cpl.xml"; - p /= s.str(); + boost::filesystem::path p = filename (); xmlpp::Document doc; xmlpp::Element* root; diff --git a/src/cpl.h b/src/cpl.h index c50d8f90..0c213f8a 100644 --- a/src/cpl.h +++ b/src/cpl.h @@ -91,6 +91,8 @@ public: std::string id () const { return _id; } + + boost::filesystem::path filename () const; bool equals (CPL const & other, EqualityOptions options, boost::function note) const; -- cgit v1.2.3