1#ifndef BENCHMARK_STRING_UTIL_H_
2#define BENCHMARK_STRING_UTIL_H_
8#include "benchmark/export.h"
9#include "internal_macros.h"
13void AppendHumanReadable(
int n, std::string* str);
15std::string HumanReadableNumber(
double n,
double one_k = 1024.0);
18#if defined(__MINGW32__)
19__attribute__((format(__MINGW_PRINTF_FORMAT, 1, 2)))
20#elif defined(__GNUC__)
21__attribute__((format(printf, 1, 2)))
24StrFormat(
const char* format, ...);
26inline std::ostream& StrCatImp(std::ostream& out) BENCHMARK_NOEXCEPT {
30template <
class First,
class... Rest>
31inline std::ostream& StrCatImp(std::ostream& out, First&& f, Rest&&... rest) {
32 out << std::forward<First>(f);
33 return StrCatImp(out, std::forward<Rest>(rest)...);
36template <
class... Args>
37inline std::string StrCat(Args&&... args) {
38 std::ostringstream ss;
39 StrCatImp(ss, std::forward<Args>(args)...);
44std::vector<std::string> StrSplit(
const std::string& str,
char delim);
48#ifdef BENCHMARK_STL_ANDROID_GNUSTL
55unsigned long stoul(
const std::string& str,
size_t* pos =
nullptr,
57int stoi(
const std::string& str,
size_t* pos =
nullptr,
int base = 10);
58double stod(
const std::string& str,
size_t* pos =
nullptr);