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

Function GenOne

tools/rescompiler/main.cpp:66–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66static inline void GenOne(const TString& data, const TString& key, IOutputStream& out, bool isFile, bool useSections) {
67 const TString name = "name" + ToString(CityHash64(key.data(), key.size()));
68
69 if (useSections) {
70 if (isFile) {
71 Formatter(out, R"__(
72 extern "C" const char {}[];
73 extern "C" const char {}_end[];
74 static const int REG_{} = NResource::LightRegisterI("{}", {}, {}_end);
75 )__", {data, data, name, key, data, data});
76 } else {
77 EmitHexArray(data, name, out);
78 Formatter(out, R"__(
79 static const int REG_{} = NResource::LightRegisterS("{}", (const char*){}, sizeof({}));
80 )__", {name, key, name, name});
81 }
82 return;
83 }
84
85 EmitHexArray(data, name, out);
86 Formatter(out, R"__(
87 static const NResource::TRegHelper REG_{}("{}", TStringBuf((const char*){}, sizeof({})));
88 )__", {name, key, name, name});
89}
90
91static inline void EmitHeader(IOutputStream& out, bool useSections) {
92 if (useSections) {

Callers 1

mainFunction · 0.70

Calls 6

EmitHexArrayFunction · 0.85
FormatterFunction · 0.70
ToStringFunction · 0.50
CityHash64Function · 0.50
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected