blob: 19b006bc93ea531e611f95b5400033fd5b60c36d [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
Elliott Hughes11d1b0c2012-01-23 16:57:47 -08009namespace art {
10
Elliott Hugheseb4f6142011-07-15 17:43:51 -070011// Returns a string corresponding to printf-like formatting of the arguments.
12std::string StringPrintf(const char* fmt, ...)
Elliott Hughes362f9bc2011-10-17 18:56:41 -070013 __attribute__((__format__(__printf__, 1, 2)));
Elliott Hugheseb4f6142011-07-15 17:43:51 -070014
15// Appends a printf-like formatting of the arguments to 'dst'.
16void StringAppendF(std::string* dst, const char* fmt, ...)
Elliott Hughes362f9bc2011-10-17 18:56:41 -070017 __attribute__((__format__(__printf__, 2, 3)));
Elliott Hugheseb4f6142011-07-15 17:43:51 -070018
19// Appends a printf-like formatting of the arguments to 'dst'.
20void StringAppendV(std::string* dst, const char* format, va_list ap);
21
Elliott Hughes11d1b0c2012-01-23 16:57:47 -080022} // namespace art
23
Elliott Hugheseb4f6142011-07-15 17:43:51 -070024#endif // STRINGPRINTF_H_