A keyset holds together a set of keys.
More...
#include <keyset.hpp>
A keyset holds together a set of keys.
- Invariant
- always holds an underlying elektra keyset.
- Note
- that the cursor is mutable, so it might be changed even in const functions as described.
Creates a new empty keyset with no keys.
kdb::KeySet::KeySet |
( |
ckdb::KeySet * |
k | ) |
|
|
inline |
Takes ownership of keyset!
Keyset will be destroyed at destructor you cant continue to use keyset afterwards!
Use KeySet::release() to avoid destruction.
- Parameters
-
k | the keyset to take the ownership from |
- See also
- release()
-
setKeySet()
kdb::KeySet::KeySet |
( |
const KeySet & |
other | ) |
|
|
inline |
Duplicate a keyset.
This keyset will be a duplicate of the other afterwards.
- Note
- that they still reference to the same Keys, so if you change key values also the keys in the original keyset will be changed.
So it is shallow copy, to create a deep copy you have to dup() every key (it still won't copy meta data, but they are COW):
- See also
- dup
kdb::KeySet::KeySet |
( |
size_t |
alloc, |
|
|
|
... |
|
) |
| |
|
inlineexplicit |
Create a new keyset.
- Parameters
-
alloc | minimum number of keys to allocate |
... | variable argument list |
kdb::KeySet::KeySet |
( |
Va |
va, |
|
|
size_t |
alloc, |
|
|
va_list |
av |
|
) |
| |
|
inlineexplicit |
Create a new keyset.
- Parameters
-
alloc | minimum number of keys to allocate |
ap | variable arguments list |
Use va as first argument to use this constructor, e.g.:
ssize_t kdb::KeySet::append |
( |
const Key & |
toAppend | ) |
|
|
inline |
append a key
- Parameters
-
- Returns
- number of keys in the keyset
Key kdb::KeySet::at |
( |
cursor_t |
pos | ) |
const |
|
inline |
Lookup a key by index.
- Parameters
-
- Returns
- the found key
void kdb::KeySet::clear |
( |
| ) |
|
|
inline |
Clear the keyset.
Keyset will have no keys afterwards.
void kdb::KeySet::copy |
( |
const KeySet & |
other | ) |
|
|
inline |
Copy a keyset.
- Parameters
-
other | other keyset to copy |
This is only a shallow copy. For a deep copy you need to dup every key.
Key kdb::KeySet::current |
( |
| ) |
const |
|
inline |
ckdb::KeySet * kdb::KeySet::dup |
( |
| ) |
const |
|
inline |
Duplicate a keyset.
- Returns
- a copy of the keys
This is only a shallow copy. For a deep copy you need to dup every key.
cursor_t kdb::KeySet::getCursor |
( |
| ) |
const |
|
inline |
ckdb::KeySet * kdb::KeySet::getKeySet |
( |
| ) |
const |
|
inline |
Key kdb::KeySet::head |
( |
| ) |
const |
|
inline |
- Returns
- alphabetical first key
Key kdb::KeySet::lookup |
( |
const Key & |
key, |
|
|
const option_t |
options = KDB_O_NONE |
|
) |
| const |
|
inline |
- Note
- That the internal key cursor will point to the found key
Key kdb::KeySet::lookup |
( |
std::string const & |
name, |
|
|
const option_t |
options = KDB_O_NONE |
|
) |
| const |
|
inline |
Lookup a key by name.
- Parameters
-
name | the name to look for |
options | some options to pass |
- Returns
- the found key
- See also
- lookup (const Key &key, const option_t options)
- Note
- That the internal key cursor will point to the found key
Key kdb::KeySet::next |
( |
| ) |
const |
|
inline |
Duplicate a keyset.
This keyset will be a duplicate of the other afterwards.
- Note
- that they still reference to the same Keys, so if you change key values also the keys in the original keyset will be changed.
void kdb::KeySet::rewind |
( |
| ) |
const |
|
inline |
void kdb::KeySet::setCursor |
( |
cursor_t |
cursor | ) |
const |
|
inline |
void kdb::KeySet::setKeySet |
( |
ckdb::KeySet * |
k | ) |
|
|
inline |
Take ownership of passed keyset.
- Parameters
-
k | the keyset to take ownership from |
- See also
- release()
-
getKeySet()
ssize_t kdb::KeySet::size |
( |
| ) |
const |
|
inline |
The size of the keyset.
- Returns
- the number of keys in the keyset
Key kdb::KeySet::tail |
( |
| ) |
const |
|
inline |
- Returns
- alphabetical last key
The documentation for this class was generated from the following file: