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