Awali
Another Weighted Automata library
version.hh
Go to the documentation of this file.
1 // This file is part of Awali.
2 // Copyright 2016-2022 Sylvain Lombardy, Victor Marsault, Jacques Sakarovitch
3 //
4 // Awali is a free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 
18 #ifndef COMMON_VERSION_HH
19 #define COMMON_VERSION_HH
20 
21 #include<string>
22 #include<stdexcept>
23 
24 
25 namespace awali {
26 namespace version {
27 
29  static constexpr unsigned major = 2;
30 
32  static constexpr unsigned minor = 1;
33 
35  static constexpr unsigned patch = 4;
36 
38  static const std::string suffix = "";
39 
41  static const std::string full
43  + "." + std::to_string(patch) + (suffix=="" ? "" : ("-"+suffix));
44 
45 
52  static constexpr unsigned fsm_json = 1;
53 
54 
55  template<unsigned version>
56  inline void check_fsmjson() {
57  if (version == 0)
58  throw std::runtime_error("Version 0 of FSM JSON was indeed not proper JSON, it is not supported by Awali anymore.");
59  if (version > fsm_json)
60  throw std::runtime_error(std::string("Version ")+std::to_string(version)+" of FSM JSON did not exist at this version (v"+full+") of Awali.");
61  }
62 
63 }// end of namespace awali::version
64 }// end of namespace awali
65 
66 #endif
std::string to_string(identities i)
void check_fsmjson()
Definition: version.hh:56
static const std::string suffix
Suffix of the version of Awali, used mostly by developers.
Definition: version.hh:38
static constexpr unsigned minor
Current minor version of Awali.
Definition: version.hh:32
static const std::string full
Completely version of Awali as a std::string.
Definition: version.hh:42
static constexpr unsigned patch
Current minor version of Awali.
Definition: version.hh:35
static constexpr unsigned major
Current major version of Awali.
Definition: version.hh:29
static constexpr unsigned fsm_json
Main version of the format FSM json used in the library.
Definition: version.hh:52
Main namespace of Awali.
Definition: ato.hh:22