Add CPL::filename().
authorCarl Hetherington <cth@carlh.net>
Wed, 28 May 2014 14:56:49 +0000 (15:56 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 28 May 2014 14:56:49 +0000 (15:56 +0100)
src/cpl.cc
src/cpl.h

index 5079b4f632b3e95b4484d19564853ff299b43d4d..1ac0621b470ccbf772bdb5f6b3bb1ff011187111 100644 (file)
@@ -191,14 +191,16 @@ CPL::add_reel (shared_ptr<Reel> 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<const Signer> 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;
index c50d8f903a790a9619c23c99f693c3363b3b3610..0c213f8aa15551d1464d8d301292804adee03ef4 100644 (file)
--- 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<void (NoteType, std::string)> note) const;