Index: src/Common/utility.h
===================================================================
--- src/Common/utility.h	(revision 681c764e5af78bfc1348f5eefaf277c0ab5c92e4)
+++ src/Common/utility.h	(revision 21a1efb16da9a4e2b7d1a53dcfcd1d812920d346)
@@ -222,4 +222,11 @@
 	std::cerr << "Warning: ";
 	warn_single( params... );
+}
+
+/// determines if `pref` is a prefix of `str`
+static inline bool isPrefix( const std::string & str, const std::string & pref ) {
+	if ( pref.size() > str.size() ) return false;
+	auto its = std::mismatch( pref.begin(), pref.end(), str.begin() );
+	return its.first == pref.end();
 }
 
