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

Method Load

tools/triecompiler/lib/main.cpp:211–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209 TString Tmp;
210
211 bool Load(IInputStream& in, const bool allowEmptyKey, const bool noValues) {
212 Y_UNUSED(noValues);
213 while (in.ReadLine(Tmp)) {
214 if (!Tmp && !allowEmptyKey) {
215 continue;
216 }
217
218 size_t sep = Tmp.find('\t');
219 if (sep == TString::npos) {
220 RemoveIfLast<TString>(Tmp, '\n');
221 Key = TKeyReader()(Tmp.data(), Tmp.size());
222 Value = TValue();
223 } else {
224 Key = TKeyReader()(Tmp.data(), sep);
225 Value = TValue();
226 while (sep != Tmp.size()) {
227 size_t sep2 = Tmp.find('\t', sep + 1);
228 if (sep2 == TString::npos) {
229 sep2 = Tmp.size();
230 }
231
232 if (sep + 1 != sep2) {
233 Value.push_back(TValueReader()(Tmp.data() + sep + 1, sep2 - sep - 1));
234 }
235 sep = sep2;
236 }
237 }
238 return true;
239 }
240 return false;
241 }
242 };
243
244 template <typename TVectorType>

Callers

nothing calls this directly

Calls 7

Y_UNUSEDFunction · 0.85
TValueClass · 0.50
ReadLineMethod · 0.45
findMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected