| 2911 | } // End of parseOption function |
| 2912 | |
| 2913 | void ASOptions::importOptions(istream& in, vector<string> &optionsVector) |
| 2914 | { |
| 2915 | char ch; |
| 2916 | string currentToken; |
| 2917 | |
| 2918 | while (in) |
| 2919 | { |
| 2920 | currentToken = ""; |
| 2921 | do |
| 2922 | { |
| 2923 | in.get(ch); |
| 2924 | if (in.eof()) |
| 2925 | break; |
| 2926 | // treat '#' as line comments |
| 2927 | if (ch == '#') |
| 2928 | while (in) |
| 2929 | { |
| 2930 | in.get(ch); |
| 2931 | if (ch == '\n') |
| 2932 | break; |
| 2933 | } |
| 2934 | |
| 2935 | // break options on spaces, tabs, commas, or new-lines |
| 2936 | if (in.eof() || ch == ' ' || ch == '\t' || ch == ',' || ch == '\n') |
| 2937 | break; |
| 2938 | else |
| 2939 | currentToken.append(1, ch); |
| 2940 | |
| 2941 | } |
| 2942 | while (in); |
| 2943 | |
| 2944 | if (currentToken.length() != 0) |
| 2945 | optionsVector.push_back(currentToken); |
| 2946 | } |
| 2947 | } |
| 2948 | |
| 2949 | string ASOptions::getOptionErrors() |
| 2950 | { |
no test coverage detected