throw CertificateChainError ("certificate chain is not consistent");
}
-static string
-spaces (int n)
-{
- string s = "";
- for (int i = 0; i < n; ++i) {
- s += " ";
- }
- return s;
-}
-
-static void
-indent (xmlpp::Element* element, int initial)
-{
- xmlpp::Node* last = 0;
- BOOST_FOREACH (xmlpp::Node * n, element->get_children()) {
- xmlpp::Element* e = dynamic_cast<xmlpp::Element*>(n);
- if (e) {
- element->add_child_text_before (e, "\n" + spaces(initial + 2));
- indent (e, initial + 2);
- last = n;
- }
- }
- if (last) {
- element->add_child_text (last, "\n" + spaces(initial));
- }
-}
-
/** Add a <Signer> and <ds:Signature> nodes to an XML node.
* @param parent XML node to add to.
* @param standard INTEROP or SMPTE.
i->write_to_cpl (reel_list, standard);
}
+ indent (root, 0);
+
if (signer) {
signer->sign (root, standard);
}
asset->add_child("Type")->add_child_text (i->type);
}
+ indent (pkl, 0);
+
if (signer) {
signer->sign (pkl, _standard);
}
#include <openssl/sha.h>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
+#include <boost/foreach.hpp>
#include <stdexcept>
#include <iostream>
#include <iomanip>
{
return opj_version ();
}
+
+string
+dcp::spaces (int n)
+{
+ string s = "";
+ for (int i = 0; i < n; ++i) {
+ s += " ";
+ }
+ return s;
+}
+
+void
+dcp::indent (xmlpp::Element* element, int initial)
+{
+ xmlpp::Node* last = 0;
+ BOOST_FOREACH (xmlpp::Node * n, element->get_children()) {
+ xmlpp::Element* e = dynamic_cast<xmlpp::Element*>(n);
+ if (e) {
+ element->add_child_text_before (e, "\n" + spaces(initial + 2));
+ indent (e, initial + 2);
+ last = n;
+ }
+ }
+ if (last) {
+ element->add_child_text (last, "\n" + spaces(initial));
+ }
+}
extern std::string private_key_fingerprint (std::string key);
extern xmlpp::Node* find_child (xmlpp::Node const * node, std::string name);
extern std::string openjpeg_version();
+extern std::string spaces (int n);
+extern void indent (xmlpp::Element* element, int initial);
}