folly/wangle -> wangle cutover
[folly.git] / folly / String.h
index 9ce4be650861b941096b2af70373079931a8d64d..04004b56f510042c62ff7edbf094d5f0692c3abc 100644 (file)
@@ -554,7 +554,30 @@ std::string join(const Delim& delimiter, Iterator begin, Iterator end) {
  * Returns a subpiece with all whitespace removed from the front of @sp.
  * Whitespace means any of [' ', '\n', '\r', '\t'].
  */
-StringPiece skipWhitespace(StringPiece sp);
+StringPiece ltrimWhitespace(StringPiece sp);
+
+/**
+ * Returns a subpiece with all whitespace removed from the back of @sp.
+ * Whitespace means any of [' ', '\n', '\r', '\t'].
+ */
+StringPiece rtrimWhitespace(StringPiece sp);
+
+/**
+ * Returns a subpiece with all whitespace removed from the back and front of @sp.
+ * Whitespace means any of [' ', '\n', '\r', '\t'].
+ */
+inline StringPiece trimWhitespace(StringPiece sp) {
+  return ltrimWhitespace(rtrimWhitespace(sp));
+}
+
+/**
+ * Returns a subpiece with all whitespace removed from the front of @sp.
+ * Whitespace means any of [' ', '\n', '\r', '\t'].
+ * DEPRECATED: @see ltrimWhitespace @see rtrimWhitespace
+ */
+inline StringPiece skipWhitespace(StringPiece sp) {
+  return ltrimWhitespace(sp);
+}
 
 /**
  * Fast, in-place lowercasing of ASCII alphabetic characters in strings.
@@ -569,9 +592,6 @@ inline void toLowerAscii(MutableStringPiece str) {
   toLowerAscii(str.begin(), str.size());
 }
 
-// glibc doesn't have strlcpy
-size_t strlcpy(char* dest, const char* const src, size_t size);
-
 } // namespace folly
 
 // Hook into boost's type traits