| 11 | namespace utils { |
| 12 | |
| 13 | bool 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 |