tstring-parse.patch 1.0 KB

1234567891011121314151617181920212223242526
  1. --- a/re2/re2.cc (index)
  2. +++ b/re2/re2.cc (working tree)
  3. @@ -1050,6 +1050,13 @@ bool Parse(const char* str, size_t n, std::string* dest) {
  4. return true;
  5. }
  6. +template <>
  7. +bool Parse(const char* str, size_t n, TString* dest) {
  8. + if (dest == NULL) return true;
  9. + dest->assign(str, n);
  10. + return true;
  11. +}
  12. +
  13. template <>
  14. bool Parse(const char* str, size_t n, absl::string_view* dest) {
  15. if (dest == NULL) return true;
  16. --- a/re2/re2.h (index)
  17. +++ b/re2/re2.h (working tree)
  18. @@ -794,6 +794,7 @@ template <typename T> struct Parse3ary : public std::false_type {};
  19. template <> struct Parse3ary<void> : public std::true_type {};
  20. template <> struct Parse3ary<std::string> : public std::true_type {};
  21. template <> struct Parse3ary<absl::string_view> : public std::true_type {};
  22. +template <> struct Parse3ary<TString> : public std::true_type {};
  23. template <> struct Parse3ary<char> : public std::true_type {};
  24. template <> struct Parse3ary<signed char> : public std::true_type {};
  25. template <> struct Parse3ary<unsigned char> : public std::true_type {};