From b468ccabdb13fca86ae8a324239d83490ef5832e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 1 Apr 2013 02:25:02 +0100 Subject: XML metadata and some other bits. --- src/lib/content.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/lib/content.cc') 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 +#include +#include #include "content.h" #include "util.h" @@ -11,6 +13,20 @@ Content::Content (boost::filesystem::path f) } +Content::Content (shared_ptr 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, shared_ptr, bool) { -- cgit v1.2.3