nomlib
Loading...
Searching...
No Matches
version.hpp
1/******************************************************************************
2
3 nomlib - C++11 cross-platform game engine
4
5Copyright (c) 2013, 2014 Jeffrey Carpenter <i8degrees@gmail.com>
6All rights reserved.
7
8Redistribution and use in source and binary forms, with or without
9modification, are permitted provided that the following conditions are met:
10
111. Redistributions of source code must retain the above copyright notice, this
12 list of conditions and the following disclaimer.
132. Redistributions in binary form must reproduce the above copyright notice,
14 this list of conditions and the following disclaimer in the documentation
15 and/or other materials provided with the distribution.
16
17THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
21ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28******************************************************************************/
29#ifndef NOMLIB_VERSION_HPP
30#define NOMLIB_VERSION_HPP
31
32// This file is auto-generated by CMake at build time;
33// See also: CMakeLists.txt.
34
35#include <string>
36#include <sstream>
37
38#include "nomlib/config.hpp"
39
40namespace nom {
41
44{
45 public:
48
51
53 VersionInfo(int major, int minor, int patch );
54
58 int major() const;
59
63 int minor() const;
64
68 int patch() const;
69
73 std::string version_string() const;
74
84 static bool convert_version_string( const std::string& ver_string,
85 VersionInfo& info);
86
87 private:
88 int major_;
89 int minor_;
90 int patch_;
91};
92
94std::ostream& operator <<(std::ostream& os, const VersionInfo& v);
95
96bool operator ==(const VersionInfo& lhs, const VersionInfo& rhs);
97bool operator !=(const VersionInfo& lhs, const VersionInfo& rhs);
98
103bool operator <(const VersionInfo& lhs, const VersionInfo& rhs);
104
109bool operator <=(const VersionInfo& lhs, const VersionInfo& rhs);
110
115bool operator >(const VersionInfo& lhs, const VersionInfo& rhs);
116
121bool operator >=(const VersionInfo& lhs, const VersionInfo& rhs);
122
128const VersionInfo NOM_VERSION(0, 13, 1);
129
133std::string revision();
134
135} // namespace nom
136
137#endif // defined include guard
Container for x.x.x version schemes.
Definition version.hpp:44
int major() const
Get the major version.
static bool convert_version_string(const std::string &ver_string, VersionInfo &info)
Convert a version string to major, minor and patch integers.
int minor() const
Get the minor revision version.
int patch() const
Get the patch level version.
VersionInfo(int major, int minor, int patch)
Construct an object with specified version fields.
VersionInfo()
Default constructor; initialize version fields to zero (0).
std::string version_string() const
Get the full version as a string.
~VersionInfo()
Destructor.