Enable or disable an option. Returns true if option value changed
| 250 | |
| 251 | // Enable or disable an option. Returns true if option value changed |
| 252 | bool setOption(typename T::Option option, bool enabled, Optional<StringRef> arg) { |
| 253 | auto optionItr = options.find(option); |
| 254 | if (enabled && (optionItr == options.end() || |
| 255 | Optional<Standalone<StringRef>>(optionItr->second).castTo<StringRef>() != arg)) { |
| 256 | options[option] = arg.castTo<Standalone<StringRef>>(); |
| 257 | return true; |
| 258 | } else if (!enabled && optionItr != options.end()) { |
| 259 | options.erase(optionItr); |
| 260 | return true; |
| 261 | } |
| 262 | |
| 263 | return false; |
| 264 | } |
| 265 | |
| 266 | // Prints a list of all enabled options in this group |
| 267 | bool print() const { |