MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / importOptions

Method importOptions

other_src/astyle/src/astyle_main.cpp:2913–2947  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2911} // End of parseOption function
2912
2913void 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
2949string ASOptions::getOptionErrors()
2950{

Callers 2

processOptionsMethod · 0.80
AStyleMainFunction · 0.80

Calls 4

getMethod · 0.45
appendMethod · 0.45
lengthMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected