string_util.h
Go to the documentation of this file.
1 #ifndef BENCHMARK_STRING_UTIL_H_
2 #define BENCHMARK_STRING_UTIL_H_
3 
4 #include <sstream>
5 #include <string>
6 #include <utility>
7 #include "internal_macros.h"
8 
9 namespace benchmark {
10 
12 
14 
15 std::string StringPrintF(const char* format, ...);
16 
17 inline std::ostream& StringCatImp(std::ostream& out) BENCHMARK_NOEXCEPT {
18  return out;
19 }
20 
21 template <class First, class... Rest>
22 inline std::ostream& StringCatImp(std::ostream& out, First&& f,
23  Rest&&... rest) {
24  out << std::forward<First>(f);
25  return StringCatImp(out, std::forward<Rest>(rest)...);
26 }
27 
28 template <class... Args>
29 inline std::string StrCat(Args&&... args) {
30  std::ostringstream ss;
31  StringCatImp(ss, std::forward<Args>(args)...);
32  return ss.str();
33 }
34 
35 void ReplaceAll(std::string* str, const std::string& from,
36  const std::string& to);
37 
38 } // end namespace benchmark
39 
40 #endif // BENCHMARK_STRING_UTIL_H_
BENCHMARK_NOEXCEPT
#define BENCHMARK_NOEXCEPT
Definition: benchmark.h:220
internal_macros.h
benchmark
Definition: benchmark.h:241
benchmark::StringCatImp
std::ostream & StringCatImp(std::ostream &out) BENCHMARK_NOEXCEPT
Definition: string_util.h:17
string
GLsizei const GLchar *const * string
Definition: glcorearb.h:3083
benchmark::ReplaceAll
void ReplaceAll(std::string *str, const std::string &from, const std::string &to)
Definition: string_util.cc:163
format
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:2773
update_failure_list.str
str
Definition: update_failure_list.py:41
n
GLdouble n
Definition: glcorearb.h:4153
Args
Args({7, 6, 3})
benchmark::HumanReadableNumber
std::string HumanReadableNumber(double n)
Definition: string_util.cc:118
benchmark::StringPrintF
std::string StringPrintF(const char *format,...)
Definition: string_util.cc:155
f
GLfloat f
Definition: glcorearb.h:3964
benchmark::AppendHumanReadable
void AppendHumanReadable(int n, std::string *str)
Definition: string_util.cc:111
benchmark::StrCat
std::string StrCat(Args &&... args)
Definition: string_util.h:29
benchmarks.python.py_benchmark.args
args
Definition: py_benchmark.py:24


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:59