Elliott Hughes | eb4f614 | 2011-07-15 17:43:51 -0700 | [diff] [blame^] | 1 | // Copyright 2011 Google Inc. All Rights Reserved. |
| 2 | // Author: enh@google.com (Elliott Hughes) |
| 3 | |
| 4 | #ifndef STRINGPRINTF_H_ |
| 5 | #define STRINGPRINTF_H_ |
| 6 | |
| 7 | #include <stdarg.h> |
| 8 | #include <string> |
| 9 | |
| 10 | // Returns a string corresponding to printf-like formatting of the arguments. |
| 11 | std::string StringPrintf(const char* fmt, ...) |
| 12 | __attribute__((__format__ (__printf__, 1, 2))); |
| 13 | |
| 14 | // Appends a printf-like formatting of the arguments to 'dst'. |
| 15 | void StringAppendF(std::string* dst, const char* fmt, ...) |
| 16 | __attribute__((__format__ (__printf__, 2, 3))); |
| 17 | |
| 18 | // Appends a printf-like formatting of the arguments to 'dst'. |
| 19 | void StringAppendV(std::string* dst, const char* format, va_list ap); |
| 20 | |
| 21 | #endif // STRINGPRINTF_H_ |