diff --git a/src/openalpr/support/filesystem.cpp b/src/openalpr/support/filesystem.cpp index 4757d5f..957750b 100644 --- a/src/openalpr/support/filesystem.cpp +++ b/src/openalpr/support/filesystem.cpp @@ -1,5 +1,14 @@ #include "filesystem.h" +bool startsWith(std::string const &fullString, std::string const &prefix) +{ + if(fullString.substr(0, prefix.size()) == prefix) { + return true; + } + + return false; +} + bool hasEnding (std::string const &fullString, std::string const &ending) { if (fullString.length() >= ending.length()) diff --git a/src/openalpr/support/filesystem.h b/src/openalpr/support/filesystem.h index e519956..e0d1372 100644 --- a/src/openalpr/support/filesystem.h +++ b/src/openalpr/support/filesystem.h @@ -17,6 +17,7 @@ #include #include +bool startsWith(std::string const &fullString, std::string const &prefix); bool hasEnding (std::string const &fullString, std::string const &ending); bool DirectoryExists( const char* pzPath ); bool fileExists( const char* pzPath );