diff options
Diffstat (limited to 'src/util.cc')
| -rw-r--r-- | src/util.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util.cc b/src/util.cc index 80c3756b..3d37454f 100644 --- a/src/util.cc +++ b/src/util.cc @@ -40,6 +40,7 @@ #include <libxml++/document.h> #include <openssl/sha.h> #include <boost/filesystem.hpp> +#include <boost/algorithm/string.hpp> #include <stdexcept> #include <sstream> #include <iostream> @@ -58,6 +59,7 @@ using std::ostream; using boost::shared_ptr; using boost::optional; using boost::function; +using boost::algorithm::trim; using namespace dcp; /** Create a UUID. @@ -356,3 +358,13 @@ dcp::relative_to_root (boost::filesystem::path root, boost::filesystem::path fil return rel; } + +bool +dcp::ids_equal (string a, string b) +{ + transform (a.begin(), a.end(), a.begin(), ::tolower); + transform (b.begin(), b.end(), b.begin(), ::tolower); + trim (a); + trim (b); + return a == b; +} |
