diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-11-22 10:44:18 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-11-22 10:44:18 +0000 |
| commit | 68808da4a0f8c60ac93cd0bbc3ea776d16503a6a (patch) | |
| tree | a2989569200259f148689dde54e4673f22a1450a /src | |
| parent | 6ccb1de9141a8666f01a970e506d79b708b47d5d (diff) | |
Content::_path to a vector.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/content.cc | 14 | ||||
| -rw-r--r-- | src/lib/content.h | 6 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/content.cc b/src/lib/content.cc index a41261998..c8f836d18 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -49,20 +49,19 @@ Content::Content (shared_ptr<const Film> f, Time p) Content::Content (shared_ptr<const Film> f, boost::filesystem::path p) : _film (f) - , _path (p) , _position (0) , _trim_start (0) , _trim_end (0) , _change_signals_frequent (false) { - + _paths.push_back (p); } Content::Content (shared_ptr<const Film> f, shared_ptr<const cxml::Node> node) : _film (f) , _change_signals_frequent (false) { - _path = node->string_child ("Path"); + _paths.push_back (node->string_child ("Path")); _digest = node->string_child ("Digest"); _position = node->number_child<Time> ("Position"); _trim_start = node->number_child<Time> ("TrimStart"); @@ -74,7 +73,7 @@ Content::as_xml (xmlpp::Node* node) const { boost::mutex::scoped_lock lm (_mutex); - node->add_child("Path")->add_child_text (_path.string()); + node->add_child("Path")->add_child_text (_paths.front().string()); node->add_child("Digest")->add_child_text (_digest); node->add_child("Position")->add_child_text (lexical_cast<string> (_position)); node->add_child("TrimStart")->add_child_text (lexical_cast<string> (_trim_start)); @@ -85,7 +84,7 @@ void Content::examine (shared_ptr<Job> job) { boost::mutex::scoped_lock lm (_mutex); - boost::filesystem::path p = _path; + boost::filesystem::path p = _paths.front (); lm.unlock (); string d; @@ -196,13 +195,14 @@ Content::identifier () const bool Content::path_valid () const { - return boost::filesystem::exists (_path); + return boost::filesystem::exists (_paths.front ()); } void Content::set_path (boost::filesystem::path path) { - _path = path; + _paths.clear (); + _paths.push_back (path); signal_changed (ContentProperty::PATH); } diff --git a/src/lib/content.h b/src/lib/content.h index 626e270bd..ad3e8ff45 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -67,7 +67,7 @@ public: boost::filesystem::path path () const { boost::mutex::scoped_lock lm (_mutex); - return _path; + return _paths.front (); } bool path_valid () const; @@ -127,8 +127,8 @@ protected: mutable boost::mutex _mutex; private: - /** Path of a file or a directory containing files */ - boost::filesystem::path _path; + /** Paths of our data files */ + std::vector<boost::filesystem::path> _paths; std::string _digest; Time _position; Time _trim_start; |
