MCPcopy Create free account
hub / github.com/CppMicroServices/CppMicroServices / PatSubstr

Method PatSubstr

framework/src/util/LDAPExpr.cpp:879–914  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

877 }
878
879 bool
880 LDAPExpr::PatSubstr(const std::string_view s, int si, const std::string_view pat, int pi)
881 {
882 if (pat.size() - pi == 0)
883 {
884 return s.size() - si == 0;
885 }
886 if (pat[pi] == LDAPExprConstants::WILDCARD())
887 {
888 pi++;
889 for (;;)
890 {
891 if (PatSubstr(s, si, pat, pi))
892 {
893 return true;
894 }
895 if (s.size() - si == 0)
896 {
897 return false;
898 }
899 si++;
900 }
901 }
902 else
903 {
904 if (s.size() - si == 0)
905 {
906 return false;
907 }
908 if (s[si] != pat[pi])
909 {
910 return false;
911 }
912 return PatSubstr(s, ++si, pat, ++pi);
913 }
914 }
915
916 bool
917 LDAPExpr::PatSubstr(const std::string_view s, const std::string_view pat)

Callers

nothing calls this directly

Calls 2

WILDCARDFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected