MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / hasPrefix

Function hasPrefix

Source/Falcor/Utils/StringUtils.cpp:37–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35namespace Falcor
36{
37bool hasPrefix(const std::string& str, const std::string& prefix, bool caseSensitive)
38{
39 if (str.size() >= prefix.size())
40 {
41 if (caseSensitive == false)
42 {
43 std::string s = str;
44 std::string pfx = prefix;
45 std::transform(str.begin(), str.end(), s.begin(), ::tolower);
46 std::transform(prefix.begin(), prefix.end(), pfx.begin(), ::tolower);
47 return s.compare(0, pfx.length(), pfx) == 0;
48 }
49 else
50 {
51 return str.compare(0, prefix.length(), prefix) == 0;
52 }
53 }
54 return false;
55}
56
57bool hasSuffix(const std::string& str, const std::string& suffix, bool caseSensitive)
58{

Callers 2

fixFbxCameraAnimationFunction · 0.85

Calls 5

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
compareMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected