FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
RexportVersion.h
Go to the documentation of this file.
1/*
2Copyright (c) 2019 Gouvernement du Québec
3
4SPDX-License-Identifier: LiLiQ-R-1.1
5License-Filename: LICENSES/EN/LiLiQ-R11unicode.txt
6*/
7
8#ifndef REXPORTVERSION_H_INCLUDED
9#define REXPORTVERSION_H_INCLUDED
10
11#include <Rcpp.h>
12#include "FMTVersion.h"
13#include "Rdefinitions.h"
14#include <string>
15
18
19namespace R
20{
22 {
24 }
25
27 {
29 }
30
32 {
34 }
35
36std::string getVersionStaticPass(Version::FMTVersion* versionobject)
37 {
39 }
40
41bool isAtLeastStaticPass(Version::FMTVersion* versionobject, int major, int minor, int patch)
42 {
43 return Version::FMTVersion::isAtLeast(major,minor,patch);
44 }
45
46bool hasFeatureStaticPass(Version::FMTVersion* versionobject, const std::string& feature)
47 {
48 return Version::FMTVersion::hasFeature(feature);
49 }
50
51std::string getLicenseStaticPass(Version::FMTVersion* versionobject, bool french)
52 {
53 const Version::FMTVersion version;
54 return version.getLicense(french);
55 }
56
57std::string getChangelogStaticPass(Version::FMTVersion* versionobject, bool french)
58 {
59 const Version::FMTVersion version;
60 return version.getChangelog(french);
61 }
62
64{
65
66 Rcpp::class_<Version::FMTVersion>("FMTversion", "@DocString(FMTVersion)")
67 .constructor("@DocString(FMTVersion())")
68 .method("getmajor", &getMajorStaticPass,
69 "@DocString(FMTVersion::getmajor)")
70 .method("getminor",&getMinorStaticPass,
71 "@DocString(FMTVersion::getminor)")
72 .method("getpatch", &getPatchStaticPass,
73 "@DocString(FMTVersion::getpatch)")
74 .method("getversion", &getVersionStaticPass,
75 "@DocString(FMTVersion::getversion)")
76 .method("isatleast", &isAtLeastStaticPass,
77 "@DocString(FMTVersion::isatleast)")
78 .method("hasfeature", &hasFeatureStaticPass,
79 "@DocString(FMTVersion::hasfeature)")
80 .method("getlicense",&getLicenseStaticPass,
81 "@DocString(FMTVersion::getlicense)")
82 .method("getchangelog",&getChangelogStaticPass,
83 "@DocString(FMTVersion::getchangelog)");
84 }
85}
86
87
88#endif // PYEXPORTVERSION_H_INCLUDED
89
RCPP_EXPOSED_AS(Version::FMTVersion)
RCPP_EXPOSED_WRAP(Version::FMTVersion)
Class exposing the version of FMT, its build date and the available features.
Definition: FMTVersion.h:40
static int getMajor()
Return the major version of FMT.
static std::string getChangelog(bool french=false)
Return the changelog as a string.
static std::string getVersion()
Return the version string of FMT (Major.Minor.Patch).
static std::string getLicense(bool french=false)
Return the license as a string.
static int getMinor()
Return the minor version of FMT.
static bool hasFeature(const std::string &name)
Test if the FMT version has the named feature (GDAL, OSI, MOSEK, PYTHON, R).
static int getPatch()
Return the patch version of FMT.
static bool isAtLeast(int major, int minor, int patch)
Test if the FMT version is at least the given major, minor and patch.
Definition: RexportCore.h:153
int getMajorStaticPass(Version::FMTVersion *versionobject)
Definition: RexportVersion.h:21
int getMinorStaticPass(Version::FMTVersion *versionobject)
Definition: RexportVersion.h:26
std::string getChangelogStaticPass(Version::FMTVersion *versionobject, bool french)
Definition: RexportVersion.h:57
std::string getVersionStaticPass(Version::FMTVersion *versionobject)
Definition: RexportVersion.h:36
bool isAtLeastStaticPass(Version::FMTVersion *versionobject, int major, int minor, int patch)
Definition: RexportVersion.h:41
int getPatchStaticPass(Version::FMTVersion *versionobject)
Definition: RexportVersion.h:31
std::string getLicenseStaticPass(Version::FMTVersion *versionobject, bool french)
Definition: RexportVersion.h:51
bool hasFeatureStaticPass(Version::FMTVersion *versionobject, const std::string &feature)
Definition: RexportVersion.h:46
void exportVersion()
Definition: RexportVersion.h:63