Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1013)

Side by Side Diff: mojo/edk/util/string_printf.h

Issue 1486923002: EDK: Add mojo::util::StringPrintf() (etc.) and convert away from base's. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: there is no try Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/edk/util/BUILD.gn ('k') | mojo/edk/util/string_printf.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // |printf()|-like formatting functions that output/append to C++ strings.
6 //
7 // TODO(vtl): We don't have the |PRINTF_FORMAT()| macros/warnings like
8 // Chromium's version -- should we? (I've rarely seen them being useful.)
9
10 #ifndef MOJO_EDK_UTIL_STRING_PRINTF_H_
11 #define MOJO_EDK_UTIL_STRING_PRINTF_H_
12
13 #include <stdarg.h>
14
15 #include <string>
16
17 #include "mojo/public/c/system/macros.h"
18
19 namespace mojo {
20 namespace util {
21
22 // Formats |printf()|-like input and returns it as an |std::string|.
23 std::string StringPrintf(const char* format, ...) MOJO_WARN_UNUSED_RESULT;
24
25 // Formats |vprintf()|-like input and returns it as an |std::string|.
26 std::string StringVPrintf(const char* format,
27 va_list ap) MOJO_WARN_UNUSED_RESULT;
28
29 // Formats |printf()|-like input and appends it to |*dest|.
30 void StringAppendf(std::string* dest, const char* format, ...);
31
32 // Formats |vprintf()|-like input and appends it to |*dest|.
33 void StringVAppendf(std::string* dest, const char* format, va_list ap);
34
35 } // namespace util
36 } // namespace mojo
37
38 #endif // MOJO_EDK_UTIL_STRING_PRINTF_H_
OLDNEW
« no previous file with comments | « mojo/edk/util/BUILD.gn ('k') | mojo/edk/util/string_printf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698