This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <filesystem> | |
| #include <iostream> | |
| #include <format> // C++20 Required | |
| namespace fs = std::filesystem; | |
| std::string to_long_path(const std::string& short_path) { | |
| return fs::canonical(short_path).string(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <charconv> | |
| #include <iostream> | |
| #include <array> | |
| constexpr auto ToString = [](auto number) constexpr -> const std::string { | |
| std::array<char, 20 /* Max chars in 64 bit number*/> buffer; | |
| if (auto [ptr, ec] = std::to_chars(buffer.data(), buffer.data() + buffer.size(), number); ec == std::errc()) | |
| { | |
| return std::string{buffer.data(), static_cast<size_t>(ptr - buffer.data())}; | |
| } |
NewerOlder