LCOV - code coverage report
Current view: top level - home/snapwebsites/snapcpp/snapwebsites/snapdatabase/snapdatabase - version.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 8 8 100.0 %
Date: 2019-12-15 17:13:15 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.13