crawlserv++  [under development]
Application for crawling and analyzing textual content of websites.
Version.hpp
Go to the documentation of this file.
1 /*
2  *
3  * ---
4  *
5  * Copyright (C) 2020 Anselm Schmidt (ans[ät]ohai.su)
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 3 of the License, or
10  * (at your option) any later version in addition to the terms of any
11  * licences already herein identified.
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
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  *
21  * ---
22  *
23  * Version.hpp
24  *
25  * General version information for crawlserv++.
26  *
27  * Created on: May 20, 2019
28  * Author: ans
29  */
30 
31 #ifndef MAIN_VERSION_HPP_
32 #define MAIN_VERSION_HPP_
33 
34 #define CRAWLSERVPP_VERSION_MAJOR 0 //NOLINT(cppcoreguidelines-macro-usage)
35 #define CRAWLSERVPP_VERSION_MINOR 0 //NOLINT(cppcoreguidelines-macro-usage)
36 #define CRAWLSERVPP_VERSION_RELEASE 1 //NOLINT(cppcoreguidelines-macro-usage)
37 #define CRAWLSERVPP_VERSION_SUFFIX "alpha" //NOLINT(cppcoreguidelines-macro-usage)
38 
39 #include <string> // std::string, std::to_string
40 #include <string_view> // std::string_view_literals
41 
44 
45  /*
46  * CONSTANTS
47  */
48 
49  using std::string_view_literals::operator""sv;
50 
53 
56 
59 
62 
64  inline constexpr std::string_view crawlservVersionSuffix{CRAWLSERVPP_VERSION_SUFFIX};
65 
67 
68  /*
69  * DECLARATION
70  */
71 
74 
75  [[nodiscard]] std::string getString();
76 
78 
79  /*
80  * IMPLEMENTATION
81  */
82 
84 
88  inline std::string getString() {
89  std::string result;
90 
91  result += std::to_string(crawlservVersionMajor);
92  result += ".";
93  result += std::to_string(crawlservVersionMinor);
94  result += ".";
95  result += std::to_string(crawlservVersionRelease);
96  result += crawlservVersionSuffix;
97 
98  return result;
99  }
100 
101 } /* namespace crawlservpp::Main::Version */
102 
103 #endif /* MAIN_VERSION_HPP_ */
#define CRAWLSERVPP_VERSION_MINOR
Definition: Version.hpp:35
constexpr auto crawlservVersionRelease
Current release (i.e. patch) version of the application.
Definition: Version.hpp:61
Namespace for version information.
Definition: Version.hpp:43
#define CRAWLSERVPP_VERSION_MAJOR
Definition: Version.hpp:34
constexpr auto crawlservVersionMajor
Major version of the application.
Definition: Version.hpp:55
#define CRAWLSERVPP_VERSION_SUFFIX
Definition: Version.hpp:37
std::string getString()
Gets the current version of crawlserv++.
Definition: Version.hpp:88
#define CRAWLSERVPP_VERSION_RELEASE
Definition: Version.hpp:36
constexpr auto crawlservVersionMinor
Minor version of the application.
Definition: Version.hpp:58
constexpr std::string_view crawlservVersionSuffix
Version suffix of the application.
Definition: Version.hpp:64