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

Method SetValue

library/cpp/yconf/patcher/unstrict_config.cpp:46–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46bool TUnstrictConfig::SetValue(const TString& path, const TString& value) {
47 try {
48 TVector<TString> vPath = SplitString(path, ".");
49 TVector<TString>::const_iterator dir = vPath.end() - 1;
50 auto sections = GetSections(GetRootSection(), vPath.begin(), dir, true);
51 bool result = false;
52 for (auto&& section : sections) {
53 Directives& directives = section->GetDirectives();
54 Directives::iterator iter = directives.find(*dir);
55 if (iter == directives.end()) {
56 Strings.push_back(value);
57 directives.insert(Directives::value_type(*dir, Strings.back().data()));
58 result = true;
59 continue;
60 };
61 if (!TCiString::compare(iter->second, value))
62 continue;
63 Strings.push_back(value);
64 iter->second = Strings.back().data();
65 result = true;
66 }
67 return result;
68 } catch (const yexception& e) {
69 ythrow yexception() << "Error while parse path " << path << ": " << e.what();
70 }
71}
72
73bool TUnstrictConfig::Remove(const TString& path) {
74 TVector<TString> vPath = SplitString(path, ".");

Callers 4

GetPendingDataSizeMethod · 0.45
GetAllPendingDataSizeMethod · 0.45
GetDebugInfoLockedMethod · 0.45
DequeueAllRunnerFunction · 0.45

Calls 11

SplitStringFunction · 0.50
value_typeFunction · 0.50
compareFunction · 0.50
endMethod · 0.45
beginMethod · 0.45
findMethod · 0.45
push_backMethod · 0.45
insertMethod · 0.45
dataMethod · 0.45
backMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected