Poplar and PopLibs
|
A set of option/value string flags to be used in various APIs. More...
#include <OptionFlags.hpp>
Public Member Functions | |
OptionFlags () | |
Construct a set of option flags. More... | |
bool | operator== (const OptionFlags &other) const |
Option flags are an exact match. More... | |
OptionFlags (initializer_list &&list) | |
Construct a set of option flags from an initializer list of string pairs. More... | |
void | set (initializer_list &&list) |
Set option flags from an initializer list of string pairs. More... | |
void | set (StringRef option, StringRef value) |
Set a single option to a value. More... | |
StringRef | at (StringRef option) const |
Retrieves the value of the given option. More... | |
void | clear () |
Remove all set flags. | |
iterator | begin () const |
Get iterators for the currently set option flags. More... | |
A set of option/value string flags to be used in various APIs.
poplar::OptionFlags::OptionFlags | ( | ) |
Construct a set of option flags.
The default constructor creates an empty set of flags.
|
inline |
Construct a set of option flags from an initializer list of string pairs.
Flags are set in the order they appear in the constructor.
Setting a flag more than once will result in the previous value for that option being overwritten.
initializer | A list of option/value string pairs to set in the flags. |
StringRef poplar::OptionFlags::at | ( | StringRef | option | ) | const |
Retrieves the value of the given option.
If the option does not exist, then an exception is thrown.
option | The option to retrieve in the flags. |
iterator poplar::OptionFlags::begin | ( | ) | const |
Get iterators for the currently set option flags.
All iterators are invalidated when a new flag is set or the option flags are re-assigned.
bool poplar::OptionFlags::operator== | ( | const OptionFlags & | other | ) | const |
Option flags are an exact match.
Each collection contains the same keys, and both collections have the same values for each key
void poplar::OptionFlags::set | ( | initializer_list && | list | ) |
Set option flags from an initializer list of string pairs.
Flags are set in the order they appear in the list.
Setting a flag more than once will result in the previous value for that option being overwritten. If the option was already set in these flags then the previous value will be overwritten.
initializer | A list of option/value string pairs to set in the flags. |
void poplar::OptionFlags::set | ( | StringRef | option, |
StringRef | value | ||
) |
Set a single option to a value.
If the option was already set in these flags then the previous value will be over- written.
option | The option to set in the flags. |
value | The value to set the option to in the flags. |