mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-07 02:52:50 +08:00
Added startsWith function
This commit is contained in:
@@ -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())
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#include <string.h>
|
||||
#include <vector>
|
||||
|
||||
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 );
|
||||
|
Reference in New Issue
Block a user