Definition at line 433 of file CmdOptions.h. References AddOption(), Impala::FileReadString(), GetOptIdx(), and mOptVal. Referenced by DoParseArgs(). 00434 { 00435 std::vector<String> lines; 00436 std::back_insert_iterator<std::vector<String> > bi(lines); 00437 FileReadString(bi, fileName, true, false); 00438 for (int i=0 ; i<lines.size() ; i++) 00439 { 00440 String& s = lines[i]; 00441 if (s[0] == '#') 00442 continue; 00443 String::size_type pos = 0; 00444 while (s[pos] == ' ') 00445 pos++; 00446 String::size_type end = s.find(' ', pos); 00447 String name = s.substr(pos, end - pos); 00448 if (end == String::npos) 00449 continue; 00450 00451 pos = end; 00452 while (s[pos] == ' ') 00453 pos++; 00454 char delim = (s[pos] == '"') ? '"' : ' '; 00455 if (delim == '"') 00456 pos++; 00457 end = s.find(delim, pos); 00458 String value = s.substr(pos, end - pos); 00459 00460 int index = GetOptIdx(name); 00461 if (index == -1) 00462 AddOption(0, name.c_str(), "read from ini file", value.c_str()); 00463 else 00464 mOptVal[index] = value; 00465 } 00466 }
Here is the call graph for this function:
|