Versioning for Thrift, remove thrift/lib/cpp/config.h
[folly.git] / folly / String.h
index 9a44f5459116c36784a3830e48c807ae0711508a..0b2b8646822131f44ac3a9d54ddcf176498b997d 100644 (file)
@@ -448,7 +448,8 @@ void splitTo(const Delim& delimiter,
 template <class T>
 using IsSplitTargetType = std::integral_constant<bool,
   std::is_arithmetic<T>::value ||
-  std::is_same<T, StringPiece>::value>;
+  std::is_same<T, StringPiece>::value ||
+  IsSomeString<T>::value>;
 
 template<bool exact = true,
          class Delim,
@@ -509,37 +510,20 @@ std::string join(const Delim& delimiter,
  */
 StringPiece skipWhitespace(StringPiece sp);
 
-} // namespace folly
-
-// Hash functions to make std::string usable with e.g. hash_map
-//
-// Handle interaction with different C++ standard libraries, which
-// expect these types to be in different namespaces.
-namespace std {
-
-template <class C>
-struct hash<std::basic_string<C> > : private hash<const C*> {
-  size_t operator()(const std::basic_string<C> & s) const {
-    return hash<const C*>::operator()(s.c_str());
-  }
-};
+/**
+ * Fast, in-place lowercasing of ASCII alphabetic characters in strings.
+ * Leaves all other characters unchanged, including those with the 0x80
+ * bit set.
+ * @param str String to convert
+ * @param len Length of str, in bytes
+ */
+void toLowerAscii(char* str, size_t length);
 
+inline void toLowerAscii(MutableStringPiece str) {
+  toLowerAscii(str.begin(), str.size());
 }
 
-#if FOLLY_HAVE_DEPRECATED_ASSOC
-#if defined(_GLIBCXX_SYMVER) && !defined(__BIONIC__)
-namespace __gnu_cxx {
-
-template <class C>
-struct hash<std::basic_string<C> > : private hash<const C*> {
-  size_t operator()(const std::basic_string<C> & s) const {
-    return hash<const C*>::operator()(s.c_str());
-  }
-};
-
-}
-#endif
-#endif
+} // namespace folly
 
 // Hook into boost's type traits
 namespace boost {