diff options
author | 2016-01-29 11:47:40 +0100 | |
---|---|---|
committer | 2016-01-29 11:47:40 +0100 | |
commit | 042050ef67a0d320469a6f8ca74bd8684ec4c409 (patch) | |
tree | 842576848565813c5f33e21fc06ad058f43a8963 /3rdparty/benchmark/src/string_util.h | |
parent | 1319453a84718ec50aafdb030eca3bac201995e3 (diff) |
Added Google Benchmark library (nw)
Included sample benchmark for eminline for native and noasm
Made GoogleTest compile only if tests are compiled
Diffstat (limited to '3rdparty/benchmark/src/string_util.h')
-rw-r--r-- | 3rdparty/benchmark/src/string_util.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/3rdparty/benchmark/src/string_util.h b/3rdparty/benchmark/src/string_util.h new file mode 100644 index 00000000000..b89fef5ff36 --- /dev/null +++ b/3rdparty/benchmark/src/string_util.h @@ -0,0 +1,44 @@ +#ifndef BENCHMARK_STRING_UTIL_H_ +#define BENCHMARK_STRING_UTIL_H_ + +#include <string> +#include <sstream> +#include <utility> +#include "internal_macros.h" + +namespace benchmark { + +void AppendHumanReadable(int n, std::string* str); + +std::string HumanReadableNumber(double n); + +std::string StringPrintF(const char* format, ...); + +inline std::ostream& +StringCatImp(std::ostream& out) BENCHMARK_NOEXCEPT +{ + return out; +} + +template <class First, class ...Rest> +inline std::ostream& +StringCatImp(std::ostream& out, First&& f, Rest&&... rest) +{ + out << std::forward<First>(f); + return StringCatImp(out, std::forward<Rest>(rest)...); +} + +template<class ...Args> +inline std::string StrCat(Args&&... args) +{ + std::ostringstream ss; + StringCatImp(ss, std::forward<Args>(args)...); + return ss.str(); +} + +void ReplaceAll(std::string* str, const std::string& from, + const std::string& to); + +} // end namespace benchmark + +#endif // BENCHMARK_STRING_UTIL_H_ |