LCOV - code coverage report
Current view: top level - src/bindings/cpp/examples - cpp_example_get.cpp (source / functions) Hit Total Coverage
Test: coverage-filtered.info Lines: 0 10 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 <keyio.hpp>
      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 :                 std::cout << k << " is " << k.get<int> () << std::endl;
      25             :         }
      26             :         else
      27             :         {
      28           0 :                 std::cerr << "No key found" << std::endl;
      29           0 :                 return 1;
      30             :         }
      31           0 : }

Generated by: LCOV version 1.13