add stringVPrintf() and stringVAppendf()
[folly.git] / folly / String.h
index 14fda430918e3af6314c5ddeeb6071f342dc1b09..efbda2f1bccb5b59db65082dacdc3046bdd63b3b 100644 (file)
@@ -186,6 +186,16 @@ std::string& stringAppendf(std::string* output,
                           FOLLY_PRINTF_FORMAT const char* format, ...)
   FOLLY_PRINTF_FORMAT_ATTR(2, 3);
 
+/**
+ * Similar to stringPrintf, but accepts a va_list argument.
+ *
+ * As with vsnprintf() itself, the value of ap is undefined after the call.
+ * These functions do not call va_end() on ap.
+ */
+std::string stringVPrintf(const char* format, va_list ap);
+void stringVPrintf(std::string* out, const char* format, va_list ap);
+std::string& stringVAppendf(std::string* out, const char* format, va_list ap);
+
 /**
  * Backslashify a string, that is, replace non-printable characters
  * with C-style (but NOT C compliant) "\xHH" encoding.  If hex_style