| 3370 | } // End of parseOption function |
| 3371 | |
| 3372 | void ASOptions::importOptions(istream &in, vector<string> &optionsVector) |
| 3373 | { |
| 3374 | char ch; |
| 3375 | string currentToken; |
| 3376 | |
| 3377 | while (in) |
| 3378 | { |
| 3379 | currentToken = ""; |
| 3380 | do |
| 3381 | { |
| 3382 | in.get(ch); |
| 3383 | if (in.eof()) |
| 3384 | break; |
| 3385 | // treat '#' as line comments |
| 3386 | if (ch == '#') |
| 3387 | while (in) |
| 3388 | { |
| 3389 | in.get(ch); |
| 3390 | if (ch == '\n' || ch == '\r') |
| 3391 | break; |
| 3392 | } |
| 3393 | |
| 3394 | // break options on spaces, tabs, commas, or new-lines |
| 3395 | if (in.eof() || ch == ' ' || ch == '\t' || ch == ',' || ch == '\n' || ch == '\r') |
| 3396 | break; |
| 3397 | else |
| 3398 | currentToken.append(1, ch); |
| 3399 | |
| 3400 | } |
| 3401 | while (in); |
| 3402 | |
| 3403 | if (currentToken.length() != 0) |
| 3404 | optionsVector.push_back(currentToken); |
| 3405 | } |
| 3406 | } |
| 3407 | |
| 3408 | string ASOptions::getOptionErrors() |
| 3409 | { |
no outgoing calls
no test coverage detected