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

Function main

tools/rescompiler/main.cpp:105–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105int main(int argc, char** argv) {
106 if (argc < 4) {
107 Cerr << "usage: " << argv[0] << " outfile [?--use-sections] [infile path]+ [- key=value]+" << Endl;
108 return 1;
109 }
110
111 TFixedBufferFileOutput out(argv[1]);
112 bool useSections = false;
113 if (TStringBuf(argv[2]) == "--use-sections") {
114 useSections = true;
115 argv += 3;
116 } else {
117 argv += 2;
118 }
119
120 EmitHeader(out, useSections);
121
122 while (*argv) {
123 if ("-"sv == *argv) {
124 TVector<TString> items = StringSplitter(TString(*(argv + 1))).Split('=').Limit(2).ToList<TString>();
125 GenOne(TString(items[1]), TString(items[0]), out, false /*isFile*/, useSections);
126 } else {
127 const char* key = *(argv + 1);
128 if (*key == '-') {
129 ++key;
130 }
131 TString data = useSections ? *argv : TUnbufferedFileInput(*argv).ReadAll();
132 GenOne(data, key, out, true /*isFile*/, useSections);
133 }
134 argv += 2;
135 }
136}

Callers

nothing calls this directly

Calls 7

StringSplitterFunction · 0.85
ReadAllMethod · 0.80
EmitHeaderFunction · 0.70
GenOneFunction · 0.70
LimitMethod · 0.45
SplitMethod · 0.45

Tested by

no test coverage detected