summaryrefslogtreecommitdiff
path: root/src/lib/content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-05-21 17:32:28 +0100
committerCarl Hetherington <cth@carlh.net>2013-05-21 17:32:28 +0100
commit2255aedd15f985796d2e6f7fcc7fb412a5d98812 (patch)
tree744d52adfdd226ce5b0220d62612710873fa77f4 /src/lib/content.cc
parent2de990b0155fcb5c3dac821ef8c2659e903d2f6e (diff)
Various more hacks; basically trying to remove Regions as an unnecessary complexity.
Diffstat (limited to 'src/lib/content.cc')
-rw-r--r--src/lib/content.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/content.cc b/src/lib/content.cc
index 9c3bcd39d..578dafd67 100644
--- a/src/lib/content.cc
+++ b/src/lib/content.cc
@@ -1,3 +1,5 @@
+/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */
+
/*
Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
@@ -25,9 +27,11 @@
using std::string;
using boost::shared_ptr;
+using boost::lexical_cast;
Content::Content (boost::filesystem::path f)
: _file (f)
+ , _time (0)
{
}
@@ -36,12 +40,14 @@ Content::Content (shared_ptr<const cxml::Node> node)
{
_file = node->string_child ("File");
_digest = node->string_child ("Digest");
+ _time = node->number_child<Time> ("Time");
}
Content::Content (Content const & o)
: boost::enable_shared_from_this<Content> (o)
, _file (o._file)
, _digest (o._digest)
+ , _time (o._time)
{
}
@@ -52,6 +58,7 @@ 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);
+ node->add_child("Time")->add_child_text (lexical_cast<string> (_time));
}
void