From d003793402ee5e9c0ee2a5a7c96e03f67f7b84cc Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 3 May 2014 12:32:26 +0100 Subject: Add ids_equal(). --- src/util.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/util.cc') 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 #include #include +#include #include #include #include @@ -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; +} -- cgit v1.2.3