Crocoddyl
 
Loading...
Searching...
No Matches
version.hpp
1
2// BSD 3-Clause License
3//
4// Copyright (C) 2019, LAAS-CNRS
5// Copyright note valid unless otherwise stated in individual files.
6// All rights reserved.
8
9#ifndef CROCODDYL_CORE_UTILS_VERSION_HPP_
10#define CROCODDYL_CORE_UTILS_VERSION_HPP_
11
12#include <sstream>
13#include <string>
14
15#include "crocoddyl/config.hh"
16
17namespace crocoddyl {
18
24inline std::string printVersion(const std::string& delimiter = ".") {
25 std::ostringstream oss;
26 oss << CROCODDYL_MAJOR_VERSION << delimiter << CROCODDYL_MINOR_VERSION
27 << delimiter << CROCODDYL_PATCH_VERSION;
28 return oss.str();
29}
30
44inline bool checkVersionAtLeast(int major_version, int minor_version,
45 int patch_version) {
46 return CROCODDYL_MAJOR_VERSION > major_version ||
47 (CROCODDYL_MAJOR_VERSION >= major_version &&
48 (CROCODDYL_MINOR_VERSION > minor_version ||
49 (CROCODDYL_MINOR_VERSION >= minor_version &&
50 CROCODDYL_PATCH_VERSION >= patch_version)));
51}
52} // namespace crocoddyl
53
54#endif // CROCODDYL_CORE_UTILS_VERSION_HPP_