LCOV - code coverage report
Current view: top level - snaplogger - version.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 8 8 100.0 %
Date: 2019-12-13 00:59:36 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  * Copyright (c) 2013-2019  Made to Order Software Corp.  All Rights Reserved
       3             :  *
       4             :  * https://snapwebsites.org/project/snaplogger
       5             :  * contact@m2osw.com
       6             :  *
       7             :  * This program is free software; you can redistribute it and/or modify
       8             :  * it under the terms of the GNU General Public License as published by
       9             :  * the Free Software Foundation; either version 2 of the License, or
      10             :  * (at your option) any later version.
      11             :  *
      12             :  * This program is distributed in the hope that it will be useful,
      13             :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      14             :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      15             :  * GNU General Public License for more details.
      16             :  *
      17             :  * You should have received a copy of the GNU General Public License along
      18             :  * with this program; if not, write to the Free Software Foundation, Inc.,
      19             :  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      20             :  */
      21             : 
      22             : /** \file
      23             :  * \brief The version of the snaplogger at compile time.
      24             :  *
      25             :  * This file records the snaplogger library version at compile time.
      26             :  *
      27             :  * The `#define` give you the library version at the time you are compiling.
      28             :  * The functions allow you to retrieve the version of a dynamically linked
      29             :  * library.
      30             :  */
      31             : 
      32             : // self
      33             : //
      34             : #include    "snaplogger/version.h"
      35             : 
      36             : 
      37             : // last include
      38             : //
      39             : #include    <snapdev/poison.h>
      40             : 
      41             : 
      42             : 
      43             : namespace snaplogger
      44             : {
      45             : 
      46             : 
      47             : 
      48             : 
      49             : /** \brief Get the major version of the library
      50             :  *
      51             :  * This function returns the major version of the running library (the
      52             :  * one you are linked against at runtime).
      53             :  *
      54             :  * \return The major version.
      55             :  */
      56           1 : int get_major_version()
      57             : {
      58           1 :     return SNAPLOGGER_VERSION_MAJOR;
      59             : }
      60             : 
      61             : 
      62             : /** \brief Get the minor version of the library.
      63             :  *
      64             :  * This function returns the minor version of the running library
      65             :  * (the one you are linked against at runtime).
      66             :  *
      67             :  * \return The release version.
      68             :  */
      69           1 : int get_release_version()
      70             : {
      71           1 :     return SNAPLOGGER_VERSION_MINOR;
      72             : }
      73             : 
      74             : 
      75             : /** \brief Get the patch version of the library.
      76             :  *
      77             :  * This function returns the patch version of the running library
      78             :  * (the one you are linked against at runtime).
      79             :  *
      80             :  * \return The patch version.
      81             :  */
      82           1 : int get_patch_version()
      83             : {
      84           1 :     return SNAPLOGGER_VERSION_PATCH;
      85             : }
      86             : 
      87             : 
      88             : /** \brief Get the full version of the library as a string.
      89             :  *
      90             :  * This function returns the major, minor, and patch versions of the
      91             :  * running library (the one you are linked against at runtime) in the
      92             :  * form of a string.
      93             :  *
      94             :  * The build version is not made available. In most cases we change
      95             :  * the build version only to run a new build, so not code will have
      96             :  * changed (some documentation and non-code files may changed between
      97             :  * build versions; but the code will work exactly the same way.)
      98             :  *
      99             :  * \return The library version.
     100             :  */
     101           1 : char const * get_version_string()
     102             : {
     103           1 :     return SNAPLOGGER_VERSION_STRING;
     104             : }
     105             : 
     106             : 
     107             : } // snaplogger namespace
     108             : // vim: ts=4 sw=4 et

Generated by: LCOV version 1.13