MCPcopy Create free account
hub / github.com/catboost/catboost / Formatter

Function Formatter

tools/rescompiler/main.cpp:11–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include <util/string/split.h>
10
11static 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
26using namespace NResource;
27

Callers 1

GenOneFunction · 0.70

Calls 5

beginMethod · 0.45
sizeMethod · 0.45
findMethod · 0.45
substrMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected