A handle that can be used to search and traverse configuration strings compatible with the WiredTiger API. More...
Public Member Functions | |
int | close (WT_CONFIG_PARSER *config_parser) |
Close the configuration scanner releasing any resources. More... | |
int | next (WT_CONFIG_PARSER *config_parser, WT_CONFIG_ITEM *key, WT_CONFIG_ITEM *value) |
Return the next key/value pair. More... | |
int | get (WT_CONFIG_PARSER *config_parser, const char *key, WT_CONFIG_ITEM *value) |
Return the value of an item in the configuration string. More... | |
A handle that can be used to search and traverse configuration strings compatible with the WiredTiger API.
To parse the contents of a list or nested configuration string use a new configuration parser handle based on the content of the WT_CONFIG_ITEM retrieved from the parent configuration string.
This could be used in C to create a configuration parser as follows:
Once the parser has been created the content can be queried directly:
Or the content can be traversed linearly:
Nested configuration values can be queried using a shorthand notation:
Nested configuration values can be traversed using multiple WT_CONFIG_PARSER handles:
int WT_CONFIG_PARSER::close | ( | WT_CONFIG_PARSER * | config_parser | ) |
Close the configuration scanner releasing any resources.
config_parser | the configuration parser handle |
int WT_CONFIG_PARSER::get | ( | WT_CONFIG_PARSER * | config_parser, |
const char * | key, | ||
WT_CONFIG_ITEM * | value | ||
) |
Return the value of an item in the configuration string.
config_parser | the configuration parser handle |
key | configuration key string |
value | the returned value |
int WT_CONFIG_PARSER::next | ( | WT_CONFIG_PARSER * | config_parser, |
WT_CONFIG_ITEM * | key, | ||
WT_CONFIG_ITEM * | value | ||
) |
Return the next key/value pair.
If an item has no explicitly assigned value, the item will be returned in key
and the value
will be set to the boolean "true"
value.
config_parser | the configuration parser handle |
key | the returned key |
value | the returned value |