Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
VersionInfo.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* VersionInfo.h (C) 2000-2018 */
9/* */
10/* Information about an object's version. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_VERSIONINFO_H
13#define ARCANE_UTILS_VERSIONINFO_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19#include <iosfwd>
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
30/*!
31 * \brief Information about a version.
32 *
33 This class contains information about an object's version.
34 The version number comprises 3 integer values:
35
36 \arg the major version number,
37 \arg the minor version number,
38 \arg the patch version number,
39
40 The major version number corresponds to a fundamental evolution
41 of the object. The minor version number corresponds to less significant evolutions. A major or minor version evolution
42 implies that binary compatibility is not maintained.
43
44 \note the sub-version number is no longer used.
45 */
46class ARCANE_UTILS_EXPORT VersionInfo
47{
48 public:
49
50 //! Constructs a null version
52
53 //! Constructs a version information
54 VersionInfo(int vmajor, int vminor, int vpatch);
55
56 /*! \brief Constructs a version information
57 * \a version_str must be in the format "M.m.p.b" where M is the major version,
58 * \m is the minor version, p is the patch number, and b is the beta number.
59 */
60 VersionInfo(const Arccore::String& version_str);
61
62 public:
63
64 //! Returns the major version number
65 int versionMajor() const { return m_major; }
66
67 //! Returns the minor version number
68 int versionMinor() const { return m_minor; }
69
70 //! Returns the patch version number
71 int versionPatch() const { return m_patch; }
72
73 //! Version number in string format
74 String versionAsString() const;
75
76 public:
77
78 // Prints the version numbers to the stream o
79 void write(std::ostream& o) const;
80
81 private:
82
83 int m_major; //!< Major version number
84 int m_minor; //!< Minor version number
85 int m_patch; //!< Patch version number
86};
87
88/*---------------------------------------------------------------------------*/
89/*---------------------------------------------------------------------------*/
90
91extern "C++" ARCANE_UTILS_EXPORT std::ostream&
92operator<<(std::ostream& o, const VersionInfo& vi);
93
94/*---------------------------------------------------------------------------*/
95/*---------------------------------------------------------------------------*/
96
97} // namespace Arcane
98
99/*---------------------------------------------------------------------------*/
100/*---------------------------------------------------------------------------*/
101
102#endif
Arcane configuration file.
int versionMajor() const
Returns the major version number.
Definition VersionInfo.h:65
VersionInfo()
Constructs a null version.
int versionMinor() const
Returns the minor version number.
Definition VersionInfo.h:68
int versionPatch() const
Returns the patch version number.
Definition VersionInfo.h:71
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::ostream & operator<<(std::ostream &ostr, eItemKind item_kind)
Output operator for a stream.