case_insensitive_string.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include "case_insensitive_char_traits.h"
  3. #include <util/generic/strbuf.h>
  4. #include <util/generic/string.h>
  5. #include <util/generic/hash.h>
  6. #include <util/string/split.h>
  7. using TCaseInsensitiveString = TBasicString<char, TCaseInsensitiveCharTraits>;
  8. using TCaseInsensitiveStringBuf = TBasicStringBuf<char, TCaseInsensitiveCharTraits>;
  9. template <>
  10. struct THash<TCaseInsensitiveStringBuf> {
  11. size_t operator()(TCaseInsensitiveStringBuf str) const noexcept;
  12. };
  13. template <>
  14. struct THash<TCaseInsensitiveString> : THash<TCaseInsensitiveStringBuf> {};
  15. namespace NStringSplitPrivate {
  16. template<>
  17. struct TStringBufOfImpl<TCaseInsensitiveStringBuf> {
  18. /*
  19. * WARN:
  20. * StringSplitter does not use TCharTraits properly.
  21. * Splitting such strings is explicitly disabled.
  22. */
  23. // using type = TCaseInsensitiveStringBuf;
  24. };
  25. template<>
  26. struct TStringBufOfImpl<TCaseInsensitiveString> : TStringBufOfImpl<TCaseInsensitiveStringBuf> {
  27. };
  28. } // namespace NStringSplitPrivate