MCPcopy Create free account
hub / github.com/dirkvranckaert/AndroidDecompiler / stringEndsWith

Method stringEndsWith

astyle/src/astyle_main.cpp:2031–2048  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2029}
2030
2031bool ASConsole::stringEndsWith(const string &str, const string &suffix) const
2032{
2033 int strIndex = (int) str.length() - 1;
2034 int suffixIndex = (int) suffix.length() - 1;
2035
2036 while (strIndex >= 0 && suffixIndex >= 0)
2037 {
2038 if (tolower(str[strIndex]) != tolower(suffix[suffixIndex]))
2039 return false;
2040
2041 --strIndex;
2042 --suffixIndex;
2043 }
2044 // suffix longer than string
2045 if (strIndex < 0 && suffixIndex >= 0)
2046 return false;
2047 return true;
2048}
2049
2050// Swap the two low order bytes of an integer value
2051// and convert 8 bit encoding to 16 bit.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected