diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/spl.cc | 7 | ||||
| -rw-r--r-- | src/lib/spl.h | 12 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/lib/spl.cc b/src/lib/spl.cc index 74538aa99..2cba229c1 100644 --- a/src/lib/spl.cc +++ b/src/lib/spl.cc @@ -28,24 +28,23 @@ using std::cout; using boost::shared_ptr; -bool +void SPL::read (boost::filesystem::path path, ContentStore* store) { _spl.clear (); + _missing = false; cxml::Document doc ("SPL"); doc.read_file (path); - bool missing = false; BOOST_FOREACH (cxml::ConstNodePtr i, doc.node_children("Entry")) { shared_ptr<Content> c = store->get(i->string_child("Digest")); if (c) { add (SPLEntry(c, i)); } else { - missing = true; + _missing = true; } } _name = path.filename().string(); - return missing; } void diff --git a/src/lib/spl.h b/src/lib/spl.h index a0b754f04..b94c08571 100644 --- a/src/lib/spl.h +++ b/src/lib/spl.h @@ -28,6 +28,10 @@ class ContentStore; class SPL { public: + SPL () + : _missing (false) + {} + void add (SPLEntry e) { _spl.push_back (e); } @@ -48,16 +52,22 @@ public: return _spl[index]; } - bool read (boost::filesystem::path path, ContentStore* store); + void read (boost::filesystem::path path, ContentStore* store); void write (boost::filesystem::path path) const; std::string name () const { return _name; } + bool missing () const { + return _missing; + } + private: std::string _name; std::vector<SPLEntry> _spl; + /** true if any content was missing when read() was last called on this SPL */ + bool _missing; }; #endif |
