blob: 413fef5f36c49e3679fa258c0d62d5b0af496d98 [file] [log] [blame]
Elliott Hugheseb4f6142011-07-15 17:43:51 -07001// Copyright 2011 Google Inc. All Rights Reserved.
Elliott Hugheseb4f6142011-07-15 17:43:51 -07002
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.
10std::string StringPrintf(const char* fmt, ...)
Elliott Hughes362f9bc2011-10-17 18:56:41 -070011 __attribute__((__format__(__printf__, 1, 2)));
Elliott Hugheseb4f6142011-07-15 17:43:51 -070012
13// Appends a printf-like formatting of the arguments to 'dst'.
14void StringAppendF(std::string* dst, const char* fmt, ...)
Elliott Hughes362f9bc2011-10-17 18:56:41 -070015 __attribute__((__format__(__printf__, 2, 3)));
Elliott Hugheseb4f6142011-07-15 17:43:51 -070016
17// Appends a printf-like formatting of the arguments to 'dst'.
18void StringAppendV(std::string* dst, const char* format, va_list ap);
19
20#endif // STRINGPRINTF_H_