| 9 | #include <util/string/split.h> |
| 10 | |
| 11 | static inline void Formatter(IOutputStream& stream, std::string_view fmt, TVector<std::string_view>&& views) { |
| 12 | constexpr auto INF = std::string::npos; |
| 13 | size_t pos = 0; |
| 14 | auto view = views.begin(); |
| 15 | while (pos != INF && pos < fmt.size()) { |
| 16 | size_t found = fmt.find("{}", pos); |
| 17 | stream << fmt.substr(pos, found == INF ? INF : found - pos); |
| 18 | pos = found == INF ? INF : found + 2; |
| 19 | if (view != views.end()) { |
| 20 | stream << *view; |
| 21 | ++view; |
| 22 | } |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | using namespace NResource; |
| 27 | |