Program Listing for File version.hpp
↰ Return to documentation for file (include/pinocchio/utils/version.hpp
)
//
// Copyright (c) 2018 CNRS
//
#ifndef __pinocchio_utils_version_hpp__
#define __pinocchio_utils_version_hpp__
#include "pinocchio/config.hpp"
#include <string>
#include <sstream>
namespace pinocchio
{
inline std::string printVersion(const std::string & delimiter = ".")
{
std::ostringstream oss;
oss
<< PINOCCHIO_MAJOR_VERSION << delimiter
<< PINOCCHIO_MINOR_VERSION << delimiter
<< PINOCCHIO_PATCH_VERSION;
return oss.str();
}
inline bool checkVersionAtLeast(unsigned int major_version,
unsigned int minor_version,
unsigned int patch_version)
{
return
PINOCCHIO_MAJOR_VERSION > major_version
|| (PINOCCHIO_MAJOR_VERSION >= major_version
&& (PINOCCHIO_MINOR_VERSION > minor_version
|| (PINOCCHIO_MINOR_VERSION >= minor_version
&& PINOCCHIO_PATCH_VERSION >= patch_version)));
}
}
#endif // __pinocchio_utils_version_hpp__