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 | |
Elliott Hughes | 11d1b0c | 2012-01-23 16:57:47 -0800 | [diff] [blame^] | 9 | namespace art { |
| 10 | |
Elliott Hughes | eb4f614 | 2011-07-15 17:43:51 -0700 | [diff] [blame] | 11 | // Returns a string corresponding to printf-like formatting of the arguments. |
| 12 | std::string StringPrintf(const char* fmt, ...) |
Elliott Hughes | 362f9bc | 2011-10-17 18:56:41 -0700 | [diff] [blame] | 13 | __attribute__((__format__(__printf__, 1, 2))); |
Elliott Hughes | eb4f614 | 2011-07-15 17:43:51 -0700 | [diff] [blame] | 14 | |
| 15 | // Appends a printf-like formatting of the arguments to 'dst'. |
| 16 | void StringAppendF(std::string* dst, const char* fmt, ...) |
Elliott Hughes | 362f9bc | 2011-10-17 18:56:41 -0700 | [diff] [blame] | 17 | __attribute__((__format__(__printf__, 2, 3))); |
Elliott Hughes | eb4f614 | 2011-07-15 17:43:51 -0700 | [diff] [blame] | 18 | |
| 19 | // Appends a printf-like formatting of the arguments to 'dst'. |
| 20 | void StringAppendV(std::string* dst, const char* format, va_list ap); |
| 21 | |
Elliott Hughes | 11d1b0c | 2012-01-23 16:57:47 -0800 | [diff] [blame^] | 22 | } // namespace art |
| 23 | |
Elliott Hughes | eb4f614 | 2011-07-15 17:43:51 -0700 | [diff] [blame] | 24 | #endif // STRINGPRINTF_H_ |