blob: b1b1d8d5888c2b20d47e19b99193d562c9e85d6b [file] [log] [blame]
Elliott Hugheseb4f6142011-07-15 17:43:51 -07001// 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.
11std::string StringPrintf(const char* fmt, ...)
12 __attribute__((__format__ (__printf__, 1, 2)));
13
14// Appends a printf-like formatting of the arguments to 'dst'.
15void 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'.
19void StringAppendV(std::string* dst, const char* format, va_list ap);
20
21#endif // STRINGPRINTF_H_