Majoranapp
A C++ library for studying MZM in non-interacting systems
Version.hpp
Go to the documentation of this file.
1 #ifndef INFO_VERSION_HPP
2 #define INFO_VERSION_HPP
3 
4 #include <armadillo>
5 
6 #include "Basics.hpp"
7 
12 {
13 private:
14  static const std::string libname;
15  static const std::string vername;
16  static const int major{0};
17  static const int minor{200};
18  static const int patch{1};
19 
23  static arma::arma_version armaVersion;
24 
25  static const nlohmann::basic_json<> jsonVer;
26 
30  static const std::string jsonVersion;
31 
37  static std::string Version()
38  {
39  return std::to_string(major) + "." +
40  std::to_string(minor) + "." +
41  std::to_string(patch);
42  }
43 
44 public:
48  static void ShowVersion()
49  {
50  // TODO set width depending on max lib name
51  std::cout << "# " << libname << " @ " << Version() << " (" << vername << ")\n";
52  std::cout << "# armadillo "
53  << " @ " << armaVersion.as_string() << "\n";
54  std::cout << "# nlohmann JSON "
55  << " @ " << jsonVersion << "\n";
57  }
58 };
59 
60 const std::string VersionInfo::libname{"Majoranapp"};
61 const std::string VersionInfo::vername{"alpha"};
62 const nlohmann::basic_json<> VersionInfo::jsonVer = nlohmann::json::meta();
63 const std::string VersionInfo::jsonVersion = VersionInfo::jsonVer["version"]["string"];
64 
65 #endif
static const int patch
Definition: Version.hpp:18
static const std::string libname
Definition: Version.hpp:14
static const int minor
Definition: Version.hpp:17
static const std::string jsonVersion
nlohmann::json version
Definition: Version.hpp:30
static const int major
Definition: Version.hpp:16
static arma::arma_version armaVersion
armadillo version
Definition: Version.hpp:23
static const nlohmann::basic_json jsonVer
Definition: Version.hpp:25
static void ShowVersion()
displays all libs version
Definition: Version.hpp:48
static void Line(int n=40)
Display line of n char (default char &#39;=&#39;)
Definition: Basics.hpp:124
static std::string Version()
returns lib version
Definition: Version.hpp:37
static const std::string vername
Definition: Version.hpp:15
Version of the lib and dependency libs.
Definition: Version.hpp:11