LCOV - code coverage report
Current view: top level - advgetopt - version.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 8 8 100.0 %
Date: 2020-11-13 17:54:34 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  * License:
       3             :  *    Copyright (c) 2006-2019  Made to Order Software Corp.  All Rights Reserved
       4             :  *
       5             :  *    https://snapwebsites.org/
       6             :  *    contact@m2osw.com
       7             :  *
       8             :  *    This program is free software; you can redistribute it and/or modify
       9             :  *    it under the terms of the GNU General Public License as published by
      10             :  *    the Free Software Foundation; either version 2 of the License, or
      11             :  *    (at your option) any later version.
      12             :  *
      13             :  *    This program is distributed in the hope that it will be useful,
      14             :  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
      15             :  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      16             :  *    GNU General Public License for more details.
      17             :  *
      18             :  *    You should have received a copy of the GNU General Public License along
      19             :  *    with this program; if not, write to the Free Software Foundation, Inc.,
      20             :  *    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      21             :  *
      22             :  * Authors:
      23             :  *    Alexis Wilke   alexis@m2osw.com
      24             :  *    Doug Barbieri  doug@m2osw.com
      25             :  */
      26             : 
      27             : /** \file
      28             :  * \brief Advanced getopt version functions.
      29             :  *
      30             :  * The advgetopt environment is versioned. The functions available here
      31             :  * give you access to the version, in case you wanted to make sure you
      32             :  * had a minimum version or had some special case options when you
      33             :  * want to be able to support various versions.
      34             :  */
      35             : 
      36             : // self
      37             : //
      38             : #include    "advgetopt/version.h"
      39             : 
      40             : 
      41             : // last include
      42             : //
      43             : #include    <snapdev/poison.h>
      44             : 
      45             : 
      46             : 
      47             : namespace advgetopt
      48             : {
      49             : 
      50             : 
      51             : 
      52             : 
      53             : /** \brief Get the major version of the library
      54             :  *
      55             :  * This function returns the version of the running library (the
      56             :  * one you are linked against at runtime).
      57             :  *
      58             :  * \return The major version.
      59             :  */
      60           1 : int get_major_version()
      61             : {
      62           1 :     return LIBADVGETOPT_VERSION_MAJOR;
      63             : }
      64             : 
      65             : 
      66             : /** \brief Get the release version of the library.
      67             :  *
      68             :  * This function returns the release version of the running library
      69             :  * (the one you are linked against at runtime).
      70             :  *
      71             :  * \return The release version.
      72             :  */
      73           1 : int get_release_version()
      74             : {
      75           1 :     return LIBADVGETOPT_VERSION_MINOR;
      76             : }
      77             : 
      78             : 
      79             : /** \brief Get the patch version of the library.
      80             :  *
      81             :  * This function returns the patch version of the running library
      82             :  * (the one you are linked against at runtime).
      83             :  *
      84             :  * \return The patch version.
      85             :  */
      86           1 : int get_patch_version()
      87             : {
      88           1 :     return LIBADVGETOPT_VERSION_PATCH;
      89             : }
      90             : 
      91             : 
      92             : /** \brief Get the full version of the library as a string.
      93             :  *
      94             :  * This function returns the major, release, and patch versions of the
      95             :  * running library (the one you are linked against at runtime) in the
      96             :  * form of a string.
      97             :  *
      98             :  * The build version is not made available.
      99             :  *
     100             :  * \return The library version.
     101             :  */
     102           1 : char const * get_version_string()
     103             : {
     104           1 :     return LIBADVGETOPT_VERSION_STRING;
     105             : }
     106             : 
     107             : 
     108             : } // advgetopt namespace
     109             : // vim: ts=4 sw=4 et

Generated by: LCOV version 1.13