diff options
author | Roland Reichwein <mail@reichwein.it> | 2022-01-06 15:30:02 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2022-01-06 15:30:02 +0100 |
commit | 69e14c9f3a9fe35a80a22f121969cef914ede063 (patch) | |
tree | eb6f78e0e28119ff8d757b794344bc55a01bb1c1 /src/test-helper.cpp | |
parent | fceee089c114e8510fd1e7f06f258b5d67cf23bf (diff) |
Adjustments for msbuild
Diffstat (limited to 'src/test-helper.cpp')
-rw-r--r-- | src/test-helper.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test-helper.cpp b/src/test-helper.cpp index d441895..d591916 100644 --- a/src/test-helper.cpp +++ b/src/test-helper.cpp @@ -5,6 +5,8 @@ #include <codecvt> #include <deque> #include <exception> +#include <iostream> +#include <iomanip> #include <limits> #include <list> #include <locale> @@ -50,6 +52,29 @@ namespace std { return os; } +#ifdef __cpp_char8_t + std::ostream& operator<<(std::ostream& os, utf8_t const& c) + { + os << "\\x" << std::setfill('0') << std::setw(2) << std::right << std::hex << static_cast<uint8_t>(c); + + return os; + } +#endif + + std::ostream& operator<<(std::ostream& os, char16_t const& c) + { + os << "\\u" << std::setfill('0') << std::setw(4) << std::right << std::hex << static_cast<uint16_t>(c); + + return os; + } + + std::ostream& operator<<(std::ostream& os, char32_t const& c) + { + os << "\\U" << std::setfill('0') << std::setw(8) << std::right << std::hex << static_cast<uint32_t>(c); + + return os; + } + } // namespace std namespace { |