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

Method Read

library/cpp/yconf/conf.cpp:83–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83bool TYandexConfig::Read(const TString& path) {
84 assert(FileData == nullptr);
85 ConfigPath = path;
86 //read the file to memory
87 TFile doc(path, OpenExisting | RdOnly);
88 if (!doc.IsOpen()) {
89 Errors.push_back(TString("can't open file ") + path + "\n");
90 return false;
91 }
92 Len = (ui32)doc.GetLength();
93 FileData = new char[Len + 1];
94 doc.Load(FileData, Len);
95 FileData[Len] = 0;
96 doc.Close();
97 return PrepareLines();
98}
99
100bool TYandexConfig::ReadMemory(const TStringBuf& buffer, const char* configPath) {
101 assert(FileData == nullptr);

Callers 4

ReadVarUInt64Function · 0.45
RefreshBlockMethod · 0.45
PeekMethod · 0.45
ESLoad<TString>Function · 0.45

Calls 5

IsOpenMethod · 0.45
push_backMethod · 0.45
GetLengthMethod · 0.45
LoadMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected