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: 2022-05-26 21:41:34 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : // Copyright (c) 2006-2022  Made to Order Software Corp.  All Rights Reserved
       2             : //
       3             : // https://snapwebsites.org/project/advgetopt
       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 Advanced getopt version functions.
      23             :  *
      24             :  * The advgetopt environment is versioned. The functions available here
      25             :  * give you access to the version, in case you wanted to make sure you
      26             :  * had a minimum version or had some special case options when you
      27             :  * want to be able to support various versions.
      28             :  */
      29             : 
      30             : // self
      31             : //
      32             : #include    "advgetopt/version.h"
      33             : 
      34             : 
      35             : // last include
      36             : //
      37             : #include    <snapdev/poison.h>
      38             : 
      39             : 
      40             : 
      41             : namespace advgetopt
      42             : {
      43             : 
      44             : 
      45             : 
      46             : 
      47             : /** \brief Get the major version of the library
      48             :  *
      49             :  * This function returns the version of the running library (the
      50             :  * one you are linked against at runtime).
      51             :  *
      52             :  * \return The major version.
      53             :  */
      54           1 : int get_major_version()
      55             : {
      56           1 :     return LIBADVGETOPT_VERSION_MAJOR;
      57             : }
      58             : 
      59             : 
      60             : /** \brief Get the release version of the library.
      61             :  *
      62             :  * This function returns the release version of the running library
      63             :  * (the one you are linked against at runtime).
      64             :  *
      65             :  * \return The release version.
      66             :  */
      67           1 : int get_release_version()
      68             : {
      69           1 :     return LIBADVGETOPT_VERSION_MINOR;
      70             : }
      71             : 
      72             : 
      73             : /** \brief Get the patch version of the library.
      74             :  *
      75             :  * This function returns the patch version of the running library
      76             :  * (the one you are linked against at runtime).
      77             :  *
      78             :  * \return The patch version.
      79             :  */
      80           1 : int get_patch_version()
      81             : {
      82           1 :     return LIBADVGETOPT_VERSION_PATCH;
      83             : }
      84             : 
      85             : 
      86             : /** \brief Get the full version of the library as a string.
      87             :  *
      88             :  * This function returns the major, release, and patch versions of the
      89             :  * running library (the one you are linked against at runtime) in the
      90             :  * form of a string.
      91             :  *
      92             :  * The build version is not made available.
      93             :  *
      94             :  * \return The library version.
      95             :  */
      96           1 : char const * get_version_string()
      97             : {
      98           1 :     return LIBADVGETOPT_VERSION_STRING;
      99             : }
     100             : 
     101             : 
     102             : } // advgetopt namespace
     103             : // vim: ts=4 sw=4 et

Generated by: LCOV version 1.13