summaryrefslogtreecommitdiff
path: root/src/util.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-09-09 16:11:02 +0100
committerCarl Hetherington <cth@carlh.net>2012-09-09 16:11:02 +0100
commit17c46c84f24071cc7f50fb439967cffb3778e4de (patch)
treed6de48dadc778487809cc557968886c15d9efa12 /src/util.cc
parent5bd1f0bf84b7ba1a59c8dc6c5c2fad5bf89b2c12 (diff)
Cope with paths having file:// at the start of them.
Diffstat (limited to 'src/util.cc')
-rw-r--r--src/util.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util.cc b/src/util.cc
index ad6a66fe..fd76e556 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -149,6 +149,16 @@ libdcp::content_kind_from_string (string type)
}
bool
+libdcp::starts_with (string big, string little)
+{
+ if (little.size() > big.size()) {
+ return false;
+ }
+
+ return big.substr (0, little.length()) == little;
+}
+
+bool
libdcp::ends_with (string big, string little)
{
if (little.size() > big.size()) {