Comments / tidying up.
authorCarl Hetherington <cth@carlh.net>
Sun, 26 Jan 2014 22:40:33 +0000 (22:40 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 26 Jan 2014 22:40:33 +0000 (22:40 +0000)
src/certificates.h
src/cpl.cc
src/kdm.cc
src/kdm.h
src/signer_chain.cc
src/signer_chain.h
src/text.cc
src/text.h
src/util.cc

index 8ec5ddd54be461f315f811b364b900f12a9aeef7..8cb570c043ac64405aed705d41d90f401c8d880a 100644 (file)
@@ -89,7 +89,7 @@ class CertificateChain
 public:
        CertificateChain () {}
 
-       void add (boost::shared_ptr<Certificate>);
+       void add (boost::shared_ptr<Certificate> c);
 
        boost::shared_ptr<Certificate> root () const;
        boost::shared_ptr<Certificate> leaf () const;
index 0cd1d6ce16e9d38ec93ef4bb76fede9a8f95ea75..a27e8fda9c04cc04a290fa984e191dd5d043fe5a 100644 (file)
@@ -83,6 +83,9 @@ CPL::CPL (boost::filesystem::path file)
        f.done ();
 }
 
+/** Add a reel to this CPL.
+ *  @param reel Reel to add.
+ */
 void
 CPL::add (shared_ptr<Reel> reel)
 {
index 92e9a756c4a6f622c79732eaff9f1253fa5b67a0..dc326556f511619d957846f9a30d211824ef9010 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 
 */
 
-#include <iomanip>
-#include <algorithm>
-#include <boost/algorithm/string.hpp>
-#include <openssl/rsa.h>
-#include <openssl/pem.h>
-#include <openssl/err.h>
-#include <libcxml/cxml.h>
-#include "AS_DCP.h"
-#include "KM_util.h"
+/** @file  src/kdm.cc
+ *  @brief KDM and KDMKey classes.
+ */
+
 #include "util.h"
 #include "kdm.h"
 #include "compose.hpp"
 #include "cpl.h"
 #include "mxf.h"
 #include "xml/kdm_smpte.h"
+#include "AS_DCP.h"
+#include "KM_util.h"
+#include <libcxml/cxml.h>
+#include <openssl/rsa.h>
+#include <openssl/pem.h>
+#include <openssl/err.h>
+#include <boost/algorithm/string.hpp>
+#include <iomanip>
+#include <algorithm>
 
 using std::list;
 using std::string;
index 567ff8444f437a949fd0f91eaf254014094406bb..f6d96b39662d3e2544bef96e2b5406a55ed8de33 100644 (file)
--- a/src/kdm.h
+++ b/src/kdm.h
@@ -18,7 +18,7 @@
 */
 
 /** @file  src/kdm.h
- *  @brief Handling of Key Delivery Messages (KDMs).
+ *  @brief KDM and KDMKey classes.
  */
 
 #ifndef LIBDCP_KDM_H
index 5f9941f973493533bb61fbac56a422ead00c6508..87bacc5302b07cfa95a6f15662638b4838524e7a 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 
 */
 
-#include <fstream>
-#include <sstream>
-#include <boost/filesystem.hpp>
-#include <boost/algorithm/string.hpp>
-#include <openssl/sha.h>
-#include <openssl/bio.h>
-#include <openssl/evp.h>
-#include "KM_util.h"
+/** @file  src/signer_chain.cc
+ *  @brief Functions to make signer chains.
+ */
+
 #include "signer_chain.h"
 #include "exceptions.h"
 #include "util.h"
+#include "KM_util.h"
+#include <openssl/sha.h>
+#include <openssl/bio.h>
+#include <openssl/evp.h>
+#include <boost/filesystem.hpp>
+#include <boost/algorithm/string.hpp>
+#include <fstream>
+#include <sstream>
 
 using std::string;
 using std::ofstream;
@@ -35,7 +39,11 @@ using std::ifstream;
 using std::stringstream;
 using std::cout;
 
-static void command (string cmd)
+/** Run a shell command.
+ *  @param cmd Command to run (UTF8-encoded).
+ */
+static void
+command (string cmd)
 {
 #ifdef LIBDCP_WINDOWS
        /* We need to use CreateProcessW on Windows so that the UTF-8/16 mess
@@ -81,11 +89,10 @@ static void command (string cmd)
 }
 
 /** Extract a public key from a private key and create a SHA1 digest of it.
- *  @param key Private key
+ *  @param private_key Private key
  *  @param openssl openssl binary name (or full path if openssl is not on the system path).
  *  @return SHA1 digest of corresponding public key, with escaped / characters.
  */
-       
 static string
 public_key_digest (boost::filesystem::path private_key, boost::filesystem::path openssl)
 {
@@ -148,6 +155,10 @@ public_key_digest (boost::filesystem::path private_key, boost::filesystem::path
        return dig;
 }
 
+/** Generate a chain of root, intermediate and leaf keys by running an OpenSSL binary.
+ *  @param directory Directory to write the files to.
+ *  @param openssl openssl binary path.
+ */
 void
 dcp::make_signer_chain (boost::filesystem::path directory, boost::filesystem::path openssl)
 {
index 034e2290db7b0c0c850c8686e27a4ddbbce107fa..f039caf31a2ad6e9bcc2c2076e95d9596646fc62 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 
 */
 
+/** @file  src/signer_chain.h
+ *  @brief Functions to make signer chains.
+ */
+
 #include <boost/filesystem.hpp>
 
 namespace dcp {
index 5d2a2d1bca4d6edf256b1e4b4ccd1271279e9790..c70e4333ea05fd9da21729c7f6b4c05d876eae70 100644 (file)
 
 */
 
+/** @file  src/text.cc
+ *  @brief Text class for parsing subtitle XML.
+ */
+
 #include "text.h"
 #include "xml.h"
 #include "font.h"
@@ -27,6 +31,10 @@ using boost::shared_ptr;
 using boost::optional;
 using namespace dcp;
 
+/** Read a &lt;Text&gt; node from a subtitle XML file, noting its contents
+ *  in this object's member variables.
+ *  @param node Node to read.
+ */
 Text::Text (shared_ptr<const cxml::Node> node)
        : v_align (CENTER)
 {
index 81992d6f9e5f14b509abdd24f5fc756699e07fae..bbb99adb3bcbfeb68e967dafdb91b221e8ae86d5 100644 (file)
 
 */
 
+/** @file  src/text.h
+ *  @brief Text class for parsing subtitle XML.
+ */
+
 #include "types.h"
 #include <boost/shared_ptr.hpp>
 #include <list>
index 767c149090db42514738eff71bd0ee58b5632000..e53556e421b73ca8916a86bae70e7d08506a4c19 100644 (file)
@@ -156,33 +156,33 @@ dcp::content_kind_to_string (ContentKind kind)
 
 /** Convert a string from a &lt;ContentKind&gt; node to a libdcp ContentKind.
  *  Reasonably tolerant about varying case.
- *  @param type Content kind string.
+ *  @param kind Content kind string.
  *  @return libdcp ContentKind.
  */
 dcp::ContentKind
-dcp::content_kind_from_string (string type)
+dcp::content_kind_from_string (string kind)
 {
-       transform (type.begin(), type.end(), type.begin(), ::tolower);
+       transform (kind.begin(), kind.end(), kind.begin(), ::tolower);
        
-       if (type == "feature") {
+       if (kind == "feature") {
                return FEATURE;
-       } else if (type == "short") {
+       } else if (kind == "short") {
                return SHORT;
-       } else if (type == "trailer") {
+       } else if (kind == "trailer") {
                return TRAILER;
-       } else if (type == "test") {
+       } else if (kind == "test") {
                return TEST;
-       } else if (type == "transitional") {
+       } else if (kind == "transitional") {
                return TRANSITIONAL;
-       } else if (type == "rating") {
+       } else if (kind == "rating") {
                return RATING;
-       } else if (type == "teaser") {
+       } else if (kind == "teaser") {
                return TEASER;
-       } else if (type == "policy") {
+       } else if (kind == "policy") {
                return POLICY;
-       } else if (type == "psa") {
+       } else if (kind == "psa") {
                return PUBLIC_SERVICE_ANNOUNCEMENT;
-       } else if (type == "advertisement") {
+       } else if (kind == "advertisement") {
                return ADVERTISEMENT;
        }