blob: 2e685d1b057b68f67d77ce0444b59c43e7662770 [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, ...)
11 __attribute__((__format__ (__printf__, 1, 2)));
12
13// Appends a printf-like formatting of the arguments to 'dst'.
14void 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'.
18void StringAppendV(std::string* dst, const char* format, va_list ap);
19
20#endif // STRINGPRINTF_H_