Add a string 'StartsWith' helper function

This commit is contained in:
Jeff Bolz 2024-02-14 17:02:45 -06:00 committed by arcady-lunarg
parent 48702616ec
commit 114dae9114
2 changed files with 15 additions and 10 deletions

View file

@ -159,6 +159,11 @@ template<class T> inline T* NewPoolObject(T, int instances)
return new(GetThreadPoolAllocator().allocate(instances * sizeof(T))) T[instances];
}
inline bool StartsWith(TString const &str, const char *prefix)
{
return str.compare(0, strlen(prefix), prefix) == 0;
}
//
// Pool allocator versions of vectors, lists, and maps
//