MCPcopy Create free account
hub / github.com/baidu/tera / LoadFlagFile

Function LoadFlagFile

src/utils/config_utils.cc:13–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11namespace utils {
12
13bool LoadFlagFile(const std::string& file) {
14 if (!IsExist(file)) {
15 return false;
16 }
17 std::string flag = "--flagfile=" + file;
18 int argc = 2;
19 char** argv = new char* [3];
20 argv[0] = const_cast<char*>("dummy");
21 argv[1] = const_cast<char*>(flag.c_str());
22 argv[2] = NULL;
23 ::google::ParseCommandLineFlags(&argc, &argv, false);
24 argv[1] = NULL;
25 delete[] argv;
26 return true;
27}
28
29} // namespace utils
30} // namespace tera

Callers 7

mainFunction · 0.85
mainFunction · 0.85
InitFlagsFunction · 0.85
NewClientMethod · 0.85
LoadTxnConfMethod · 0.85
ReloadConfigMethod · 0.85
CmdCtrlMethod · 0.85

Calls 1

IsExistFunction · 0.50

Tested by 1

LoadTxnConfMethod · 0.68