MCPcopy Create free account
hub / github.com/OSGeo/gdal / CPLCompareKeyValueString

Function CPLCompareKeyValueString

port/cplstringlist.cpp:749–779  ·  view source on GitHub ↗

Case insensitive comparison function */

Source from the content-addressed store, hash-verified

747
748/* Case insensitive comparison function */
749static int CPLCompareKeyValueString(const char *pszKVa, const char *pszKVb)
750{
751 const char *pszItera = pszKVa;
752 const char *pszIterb = pszKVb;
753 while (true)
754 {
755 char cha = *pszItera;
756 char chb = *pszIterb;
757 if (cha == '=' || cha == '\0')
758 {
759 if (chb == '=' || chb == '\0')
760 return 0;
761 else
762 return -1;
763 }
764 if (chb == '=' || chb == '\0')
765 {
766 return 1;
767 }
768 if (cha >= 'a' && cha <= 'z')
769 cha -= ('a' - 'A');
770 if (chb >= 'a' && chb <= 'z')
771 chb -= ('a' - 'A');
772 if (cha < chb)
773 return -1;
774 else if (cha > chb)
775 return 1;
776 pszItera++;
777 pszIterb++;
778 }
779}
780
781/************************************************************************/
782/* Sort() */

Callers 3

cplstringlist.cppFile · 0.85
FindNameMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected