Definition at line 446 of file CmdOptions.h. References AddOption(), Impala::FileReadString(), GetOptIdx(), and mOptVal. Referenced by DoParseArgs(). 00447 { 00448 std::vector<String> lines; 00449 std::back_insert_iterator<std::vector<String> > bi(lines); 00450 FileReadString(bi, fileName, true, false); 00451 for (int i=0 ; i<lines.size() ; i++) 00452 { 00453 String& s = lines[i]; 00454 if (s[0] == '#') 00455 continue; 00456 String::size_type pos = 0; 00457 while (s[pos] == ' ') 00458 pos++; 00459 String::size_type end = s.find(' ', pos); 00460 String name = s.substr(pos, end - pos); 00461 if (end == String::npos) 00462 continue; 00463 00464 pos = end; 00465 while (s[pos] == ' ') 00466 pos++; 00467 char delim = (s[pos] == '"') ? '"' : ' '; 00468 if (delim == '"') 00469 pos++; 00470 end = s.find(delim, pos); 00471 String value = s.substr(pos, end - pos); 00472 00473 int index = GetOptIdx(name); 00474 if (index == -1) 00475 AddOption(0, name.c_str(), "read from ini file", value.c_str()); 00476 else 00477 mOptVal[index] = value; 00478 } 00479 }
Here is the call graph for this function: ![]()
|