1 #ifndef BENCHMARK_STRING_UTIL_H_
2 #define BENCHMARK_STRING_UTIL_H_
9 #include "benchmark/benchmark.h"
10 #include "benchmark/export.h"
16 std::string HumanReadableNumber(
double n, Counter::OneK one_k);
19 #if defined(__MINGW32__)
20 __attribute__((format(__MINGW_PRINTF_FORMAT, 1, 2)))
21 #elif defined(__GNUC__)
22 __attribute__((format(printf, 1, 2)))
25 StrFormat(
const char* format, ...);
27 inline std::ostream& StrCatImp(std::ostream& out) BENCHMARK_NOEXCEPT {
31 template <
class First,
class... Rest>
32 inline std::ostream& StrCatImp(std::ostream& out, First&& f, Rest&&... rest) {
33 out << std::forward<First>(f);
34 return StrCatImp(out, std::forward<Rest>(rest)...);
37 template <
class... Args>
38 inline std::string StrCat(Args&&... args) {
39 std::ostringstream ss;
40 StrCatImp(ss, std::forward<Args>(args)...);
45 std::vector<std::string> StrSplit(
const std::string& str,
char delim);
49 #ifdef BENCHMARK_STL_ANDROID_GNUSTL
56 unsigned long stoul(
const std::string& str,
size_t* pos =
nullptr,
58 int stoi(
const std::string& str,
size_t* pos =
nullptr,
int base = 10);
59 double stod(
const std::string& str,
size_t* pos =
nullptr);