summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-09-25 13:48:46 +0100
committerCarl Hetherington <cth@carlh.net>2013-09-25 13:48:46 +0100
commitb405b414993458babbb4532ddeeef9928ec7c06e (patch)
tree979fbbccf48bdc2f2d8c5f157cc947f02a7d5f11 /src
parentf8005516a681b805ccc2d929f63312ac711fdc24 (diff)
Add as_xml to string to KDM.
Diffstat (limited to 'src')
-rw-r--r--src/kdm.cc7
-rw-r--r--src/kdm.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/kdm.cc b/src/kdm.cc
index ac83e790..8f244500 100644
--- a/src/kdm.cc
+++ b/src/kdm.cc
@@ -154,6 +154,13 @@ KDM::as_xml (boost::filesystem::path path) const
doc->write_to_file_formatted (path.string(), "UTF-8");
}
+string
+KDM::as_xml () const
+{
+ shared_ptr<xmlpp::Document> doc = xml_kdm->as_xml ();
+ return doc->write_to_string_formatted ("UTF-8");
+}
+
KDMKey::KDMKey (shared_ptr<const Signer> signer, string cpl_id, string key_id, boost::posix_time::ptime from, boost::posix_time::ptime until, Key key)
: _cpl_id (cpl_id)
, _key_id (key_id)
diff --git a/src/kdm.h b/src/kdm.h
index ffcb65a7..ba17ee6b 100644
--- a/src/kdm.h
+++ b/src/kdm.h
@@ -22,6 +22,7 @@
#include <boost/filesystem.hpp>
#include <boost/scoped_ptr.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
#include "key.h"
#include "metadata.h"
@@ -107,6 +108,7 @@ public:
}
void as_xml (boost::filesystem::path) const;
+ std::string as_xml () const;
private:
/** Unencrypted MXF content keys */