LCOV - code coverage report
Current view: top level - src/bindings/cpp/examples - cpp_example_dup.cpp (source / functions) Hit Total Coverage
Test: coverage-filtered.info Lines: 0 12 0.0 %
Date: 2022-05-21 16:19:22 Functions: 0 0 -

          Line data    Source code
       1             : /**
       2             :  * @file
       3             :  *
       4             :  * @brief
       5             :  *
       6             :  * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
       7             :  */
       8             : 
       9             : #include <keyset.hpp>
      10             : 
      11             : //! [ksDeepCopy]
      12           0 : kdb::KeySet ksDeepCopy (kdb::KeySet orig)
      13             : {
      14           0 :         kdb::KeySet deepCopy;
      15           0 :         orig.rewind ();
      16           0 :         while (orig.next ())
      17             :         {
      18           0 :                 deepCopy.append (orig.current ().dup ());
      19             :         }
      20           0 :         return deepCopy;
      21             : }
      22             : //! [ksDeepCopy]
      23             : 
      24           0 : int main ()
      25             : {
      26           0 :         kdb::KeySet orig (3, *kdb::Key ("user:/key3/1", KEY_END), *kdb::Key ("user:/key3/2", KEY_END),
      27           0 :                           *kdb::Key ("user:/key3/3", KEY_VALUE, "value", KEY_END), KS_END);
      28           0 :         kdb::KeySet flatCopy (orig);
      29           0 :         kdb::KeySet deepCopy = ksDeepCopy (orig);
      30           0 : }

Generated by: LCOV version 1.13