A pair of key and value for command line option.
More...
#include <OptionPlugin.hpp>
A pair of key and value for command line option.
◆ OptKeyValue() [1/6]
| CGRAOmp::OptKeyValue::OptKeyValue |
( |
| ) |
|
|
inline |
Default constructor Instances made by this constructor are always invalidated.
◆ OptKeyValue() [2/6]
| CGRAOmp::OptKeyValue::OptKeyValue |
( |
string |
key, |
|
|
string |
value |
|
) |
| |
|
inline |
Construct a new Key-Value object.
- Parameters
-
| key | key of string |
| value | value of string |
◆ OptKeyValue() [3/6]
| CGRAOmp::OptKeyValue::OptKeyValue |
( |
const char * |
s | ) |
|
|
inline |
converting constructor from char*
- Parameters
-
| s | string
- It must be "key=value".
- Otherwise, the instance will be invalidated
|
◆ OptKeyValue() [4/6]
| CGRAOmp::OptKeyValue::OptKeyValue |
( |
string |
keyvalue | ) |
|
converting constructor from std::string
- Parameters
-
| s | string
- It must be "key=value".
- Otherwise, the instance will be invalidated
|
It parses a string based on a regular expression
◆ OptKeyValue() [5/6]
| CGRAOmp::OptKeyValue::OptKeyValue |
( |
const OptKeyValue & |
| ) |
|
|
default |
◆ OptKeyValue() [6/6]
◆ get()
| pair<string, string> CGRAOmp::OptKeyValue::get |
( |
| ) |
|
|
inline |
Get both key and value.
- Returns
- pair<string, string>, the first is key, and the second is value.
◆ get_key()
| string CGRAOmp::OptKeyValue::get_key |
( |
| ) |
const |
|
inline |
Get the key.
- Returns
- string of key
◆ get_value()
| string CGRAOmp::OptKeyValue::get_value |
( |
| ) |
const |
|
inline |
Get the value.
- Returns
- string of value
◆ operator bool()
| CGRAOmp::OptKeyValue::operator bool |
( |
| ) |
const |
|
inlineexplicitnoexcept |
explicit operator for bool
- Returns
- true in the case of valid key-value
-
Otherwise, false
The following code can check wherether the option is valid or not.
cl::opt<OptKeyValue> MyOption("optname");
...
if (MyOption) {
} else {
}
◆ operator!=()
| bool CGRAOmp::OptKeyValue::operator!= |
( |
const OptKeyValue & |
rhs | ) |
|
|
inline |
◆ operator=() [1/2]
copy assignement operator
◆ operator=() [2/2]
◆ operator==()
| bool CGRAOmp::OptKeyValue::operator== |
( |
const OptKeyValue & |
rhs | ) |
|
|
inline |
◆ key
| string CGRAOmp::OptKeyValue::key |
|
private |
◆ valid
| bool CGRAOmp::OptKeyValue::valid |
|
private |
◆ value
| string CGRAOmp::OptKeyValue::value |
|
private |
The documentation for this class was generated from the following files: