| 172 | } |
| 173 | |
| 174 | void ParseLogFASpec(const vector<string>& speclist, string& w_on, string& w_off) |
| 175 | { |
| 176 | std::ostringstream son, soff; |
| 177 | |
| 178 | for (auto& s: speclist) |
| 179 | { |
| 180 | string name; |
| 181 | bool on = true; |
| 182 | if (s[0] == '+') |
| 183 | name = s.substr(1); |
| 184 | else if (s[0] == '~') |
| 185 | { |
| 186 | name = s.substr(1); |
| 187 | on = false; |
| 188 | } |
| 189 | else |
| 190 | name = s; |
| 191 | |
| 192 | if (on) |
| 193 | son << "," << name; |
| 194 | else |
| 195 | soff << "," << name; |
| 196 | } |
| 197 | |
| 198 | const string& sons = son.str(); |
| 199 | const string& soffs = soff.str(); |
| 200 | |
| 201 | w_on = sons.empty() ? string() : sons.substr(1); |
| 202 | w_off = soffs.empty() ? string() : soffs.substr(1); |
| 203 | } |
| 204 | |
| 205 | |