Key-value pattern recognition class are members of this namespace.
More...
Classes | |
| class | KeyInSingle |
| Pattern where a value::Single object, recognised as a key, is followed by any value::Value. More... | |
| class | KeysInMatrix |
| Pattern made by a value::Matrix where all elements either in the first row or in the first column are keys. More... | |
| class | KeysInVector |
| Pattern made by a value::Vector whose entries are keys followed by a value::Vector or value::Matrix. More... | |
| class | Pattern |
Protocol class which defines the interface for pattern recognition classes. More... | |
| class | Table |
| Pattern where a value::Matrix contains the row, column and table keys. More... | |
Functions | |
| bool | isKey (const value::Variant &variant) |
| Checks if variant may be considered as a key. | |
| string | getKey (const value::Variant &variant) |
| Gets the key held by variant. | |
Key-value pattern recognition class are members of this namespace.
| bool keyvalue::pattern::isKey | ( | const value::Variant & | variant | ) |
Checks if variant may be considered as a key.
The check is successful if the following conditions hold:
string S; | variant | : value::Variant to be checked. |
false. | string keyvalue::pattern::getKey | ( | const value::Variant & | variant | ) |
Gets the key held by variant.
More precisely, the key is what remains after the following operations are performed in the string held by variant :
The debug version of this method checks if variant may be considered as a key (by calling isKey()) and throws an exception when the check fails. The release version of this method has undefined behavior when variant may not be considered as a key.
| variant | : value::Variant to be checked. |
| LogicError | : (Debug built only) If variant may not be considered as a key. |
1.7.1