diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-01-06 08:28:18 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-01-10 13:09:45 +0000 |
| commit | 93f29880839dc5589bb35f63260a7152ead7655f (patch) | |
| tree | 865dd65298dd11d949efed2ac3f58f3564c7cc8f /src/util.cc | |
| parent | d7965cce4c5f95da7971bce6f800739a4cd2f17d (diff) | |
Introduce dc::Package, changing lots of namespaces in the process.
Diffstat (limited to 'src/util.cc')
| -rw-r--r-- | src/util.cc | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/util.cc b/src/util.cc index 6519f11f..031f75c0 100644 --- a/src/util.cc +++ b/src/util.cc @@ -67,7 +67,7 @@ using namespace dcp::dc; * @return UUID. */ string -dcp::dc::make_uuid () +dcp::make_uuid () { char buffer[64]; Kumu::UUID id; @@ -84,7 +84,7 @@ dcp::dc::make_uuid () * @return Digest. */ string -dcp::dc::make_digest (boost::filesystem::path filename, function<void (float)> progress) +dcp::make_digest (boost::filesystem::path filename, function<void (float)> progress) { Kumu::FileReader reader; Kumu::Result_t r = reader.OpenRead (filename.string().c_str ()); @@ -131,7 +131,7 @@ dcp::dc::make_digest (boost::filesystem::path filename, function<void (float)> p * @return string. */ string -dcp::dc::content_kind_to_string (ContentKind kind) +dcp::content_kind_to_string (ContentKind kind) { switch (kind) { case FEATURE: @@ -164,8 +164,8 @@ dcp::dc::content_kind_to_string (ContentKind kind) * @param kind Content kind string. * @return libdcp ContentKind. */ -dcp::dc::ContentKind -dcp::dc::content_kind_from_string (string kind) +dcp::ContentKind +dcp::content_kind_from_string (string kind) { transform (kind.begin(), kind.end(), kind.begin(), ::tolower); @@ -198,7 +198,7 @@ dcp::dc::content_kind_from_string (string kind) * @return true if the string contains only space, newline or tab characters, or is empty. */ bool -dcp::dc::empty_or_white_space (string s) +dcp::empty_or_white_space (string s) { for (size_t i = 0; i < s.length(); ++i) { if (s[i] != ' ' && s[i] != '\n' && s[i] != '\t') { @@ -213,7 +213,7 @@ dcp::dc::empty_or_white_space (string s) * by client applications. */ void -dcp::dc::init () +dcp::init () { if (xmlSecInit() < 0) { throw MiscError ("could not initialise xmlsec"); @@ -234,17 +234,17 @@ dcp::dc::init () } } -bool dcp::dc::operator== (Size const & a, Size const & b) +bool dcp::operator== (Size const & a, Size const & b) { return (a.width == b.width && a.height == b.height); } -bool dcp::dc::operator!= (Size const & a, Size const & b) +bool dcp::operator!= (Size const & a, Size const & b) { return !(a == b); } -ostream& dcp::dc::operator<< (ostream& s, Size const & a) +ostream& dcp::operator<< (ostream& s, Size const & a) { s << a.width << "x" << a.height; return s; @@ -260,7 +260,7 @@ ostream& dcp::dc::operator<< (ostream& s, Size const & a) * @return Number of characters written to the output buffer. */ int -dcp::dc::base64_decode (string const & in, unsigned char* out, int out_length) +dcp::base64_decode (string const & in, unsigned char* out, int out_length) { BIO* b64 = BIO_new (BIO_f_base64 ()); @@ -293,7 +293,7 @@ dcp::dc::base64_decode (string const & in, unsigned char* out, int out_length) * with this wrapper. */ FILE * -dcp::dc::fopen_boost (boost::filesystem::path p, string t) +dcp::fopen_boost (boost::filesystem::path p, string t) { #ifdef LIBDCP_WINDOWS wstring w (t.begin(), t.end()); @@ -305,7 +305,7 @@ dcp::dc::fopen_boost (boost::filesystem::path p, string t) } optional<boost::filesystem::path> -dcp::dc::relative_to_root (boost::filesystem::path root, boost::filesystem::path file) +dcp::relative_to_root (boost::filesystem::path root, boost::filesystem::path file) { boost::filesystem::path::const_iterator i = root.begin (); boost::filesystem::path::const_iterator j = file.begin (); @@ -328,7 +328,7 @@ dcp::dc::relative_to_root (boost::filesystem::path root, boost::filesystem::path } bool -dcp::dc::ids_equal (string a, string b) +dcp::ids_equal (string a, string b) { transform (a.begin(), a.end(), a.begin(), ::tolower); transform (b.begin(), b.end(), b.begin(), ::tolower); @@ -338,7 +338,7 @@ dcp::dc::ids_equal (string a, string b) } string -dcp::dc::file_to_string (boost::filesystem::path p, uintmax_t max_length) +dcp::file_to_string (boost::filesystem::path p, uintmax_t max_length) { uintmax_t len = boost::filesystem::file_size (p); if (len > max_length) { @@ -365,7 +365,7 @@ dcp::dc::file_to_string (boost::filesystem::path p, uintmax_t max_length) * @return SHA1 fingerprint of key */ string -dcp::dc::private_key_fingerprint (string key) +dcp::private_key_fingerprint (string key) { boost::replace_all (key, "-----BEGIN RSA PRIVATE KEY-----\n", ""); boost::replace_all (key, "\n-----END RSA PRIVATE KEY-----\n", ""); @@ -384,7 +384,7 @@ dcp::dc::private_key_fingerprint (string key) } xmlpp::Node * -dcp::dc::find_child (xmlpp::Node const * node, string name) +dcp::find_child (xmlpp::Node const * node, string name) { xmlpp::Node::NodeList c = node->get_children (); xmlpp::Node::NodeList::iterator i = c.begin(); @@ -397,7 +397,7 @@ dcp::dc::find_child (xmlpp::Node const * node, string name) } string -dcp::dc::remove_urn_uuid (string raw) +dcp::remove_urn_uuid (string raw) { DCP_ASSERT (raw.substr(0, 9) == "urn:uuid:"); return raw.substr (9); |
