Elektra: comparison.hpp File Reference

Elektra 0.8.24

Namespaces | Functions
comparison.hpp File Reference

Comparison helper functions. More...

`#include <kdb.hpp>`
`#include <string>`

## Namespaces
| kdb
| This is the main namespace for the C++ binding and libraries.
| kdb::tools
| This namespace is for the libtool library.

## Functions
bool | kdb::tools::helper::keyDataEqual (const Key &, const Key &)
| Determines if two keys are equal based on their string value If one of the two keys is null, false is returned. More...
bool | kdb::tools::helper::keyMetaEqual (Key &, Key &)
| Determines if two keys have equal metadata. More...

## Detailed Description

Comparison helper functions.

Copyright
  BSD License (see LICENSE.md or https://www.libelektra.org)

## Function Documentation

## ◆ keyDataEqual()

bool kdb::tools::helper::keyDataEqual | ( | const Key & | k1,
|  | const Key & | k2
| ) |  |

Determines if two keys are equal based on their string value If one of the two keys is null, false is returned.

Parameters

  k1 | the first key to be compared
  k2 | the second key to be compared

Returns
  true if both keys are not null and have an equal string value, false otherwise

## ◆ keyMetaEqual()

bool kdb::tools::helper::keyMetaEqual | ( | Key & | k1,
|  | Key & | k2
| ) |  |

Determines if two keys have equal metadata.

The keys are not const because their meta cursor is changed

Parameters

  k1 | the first key whose metadata should be compared
  k2 | the second key whose metadata should be compared

Returns
  true if the keys have equal metadata, false otherwise