libxcks  0.1.0.1
version.cpp
Go to the documentation of this file.
1 /*
2  * libxcks
3  * Copyright (C) 2022 Julien Couot
4  *
5  * This program is free software: you can redistribute it and/or modify it
6  * under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13  * License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
25 //---------------------------------------------------------------------------
26 #include <boost/locale.hpp>
27 // #include <string> // Done in headers
28 
29 #include "libxcks/version.hpp"
30 #include "libxcks/defs.hpp"
31 //---------------------------------------------------------------------------
32 
33 
35 using namespace std;
36 
38 using namespace boost::locale;
39 //---------------------------------------------------------------------------
40 
41 
42 namespace libxcks
43 {
49 const std::string getLibraryName()
50 {
51  return LIBXCKS_NAME;
52 }
53 //---------------------------------------------------------------------------
54 
55 
61 const std::string getLibraryVersion()
62 {
63  return LIBXCKS_STR_VER;
64 }
65 //---------------------------------------------------------------------------
66 
67 
73 const std::string getLibraryNameAndVersion()
74 {
75  return (format(translate("version", "{1} {2}").str(libxcks_domain)) % getLibraryName() % getLibraryVersion()).str();
76 }
77 //---------------------------------------------------------------------------
78 
79 } // namespace libxcks
80 //---------------------------------------------------------------------------
Common definitions for libxcks.
constexpr const char * libxcks_domain
Domain for translations (i18n).
Definition: defs.hpp:47
#define LIBXCKS_NAME
Library's name.
Definition: verdefs.hpp:55
#define LIBXCKS_STR_VER
libxcks's version
Definition: verdefs.hpp:52
Version of the library.
LIBXCKS_SO_EXPORT const std::string getLibraryVersion()
Gets the version of the library.
Definition: version.cpp:61
LIBXCKS_SO_EXPORT const std::string getLibraryName()
Gets the name of the library.
Definition: version.cpp:49
LIBXCKS_SO_EXPORT const std::string getLibraryNameAndVersion()
Gets the name and the version of the library.
Definition: version.cpp:73