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

Method Load

tools/triecompiler/lib/main.cpp:173–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171 TValue Value;
172 TString Tmp;
173 bool Load(IInputStream& in, const bool allowEmptyKey, const bool noValues) {
174 while (in.ReadLine(Tmp)) {
175 if (!Tmp) {
176 // there is a special case for TrieSet with empty keys allowed
177 if (!(noValues && allowEmptyKey)) {
178 continue;
179 }
180 }
181
182 const size_t sep = Tmp.find('\t');
183 if (sep != TString::npos) {
184 if (0 == sep && !allowEmptyKey) {
185 continue;
186 }
187 Key = TKeyReader()(Tmp.data(), sep);
188 Value = TValueReader()(Tmp.data() + sep + 1, Tmp.size() - sep - 1);
189 } else if (noValues) {
190 RemoveIfLast<TString>(Tmp, '\n');
191 Key = TKeyReader()(Tmp.data(), Tmp.size());
192 Value = TValue();
193 }
194 return true;
195 }
196 return false;
197 }
198 };
199
200 template <class TTKey, class TTKeyChar, class T,

Callers 3

ProcessFileFunction · 0.45
VerifyFileFunction · 0.45
IsElfFunction · 0.45

Calls 5

TValueClass · 0.50
ReadLineMethod · 0.45
findMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected