LCOV - code coverage report
Current view: top level - src/bindings/cpp/examples - cpp_example_set.cpp (source / functions) Hit Total Coverage
Test: coverage-filtered.info Lines: 0 13 0.0 %
Date: 2022-05-21 16:19:22 Functions: 0 1 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 <kdb.hpp>
      10             : 
      11             : #include <iostream>
      12             : 
      13             : using namespace kdb;
      14             : 
      15           0 : int main ()
      16             : {
      17           0 :         KeySet config;
      18           0 :         KDB kdb;
      19           0 :         kdb.get (config, "/sw/MyApp");
      20             : 
      21           0 :         Key k = config.lookup ("/sw/MyApp/mykey");
      22           0 :         if (k)
      23             :         {
      24           0 :                 k.set<int> (k.get<int> () + 1);
      25             :         }
      26             :         else
      27             :         {
      28           0 :                 Key n;
      29           0 :                 n.setName ("user:/sw/MyApp/mykey");
      30           0 :                 n.set<int> (0);
      31           0 :                 config.append (n);
      32             :         }
      33             : 
      34           0 :         kdb.set (config, "/sw/MyApp");
      35           0 : }

Generated by: LCOV version 1.13