summaryrefslogtreecommitdiff
path: root/src/lib/content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-04-01 02:25:02 +0100
committerCarl Hetherington <cth@carlh.net>2013-04-01 02:25:02 +0100
commitb468ccabdb13fca86ae8a324239d83490ef5832e (patch)
tree816332e6d3437b3924c1fdf6ada7d61965136337 /src/lib/content.cc
parent640c53f0a5f178a894ff2718bf6d74e9e977eb80 (diff)
XML metadata and some other bits.
Diffstat (limited to 'src/lib/content.cc')
-rw-r--r--src/lib/content.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/content.cc b/src/lib/content.cc
index 2fb94e959..977f2e2a7 100644
--- a/src/lib/content.cc
+++ b/src/lib/content.cc
@@ -1,4 +1,6 @@
#include <boost/thread/mutex.hpp>
+#include <libxml++/libxml++.h>
+#include <libcxml/cxml.h>
#include "content.h"
#include "util.h"
@@ -11,6 +13,20 @@ Content::Content (boost::filesystem::path f)
}
+Content::Content (shared_ptr<const cxml::Node> node)
+{
+ _file = node->string_child ("File");
+ _digest = node->string_child ("Digest");
+}
+
+void
+Content::as_xml (xmlpp::Node* node) const
+{
+ boost::mutex::scoped_lock lm (_mutex);
+ node->add_child("File")->add_child_text (_file.string());
+ node->add_child("Digest")->add_child_text (_digest);
+}
+
void
Content::examine (shared_ptr<Film>, shared_ptr<Job>, bool)
{