#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include <boost/foreach.hpp>
+#include <iostream>
+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;
+ _id = doc.string_child("Id");
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
{
xmlpp::Document doc;
xmlpp::Element* root = doc.create_root_node ("SPL");
+ root->add_child("Id")->add_child_text (_id);
BOOST_FOREACH (SPLEntry i, _spl) {
i.as_xml (root->add_child("Entry"));
}