FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
RexportVersion.hpp
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.hpp"
13#include "Rdefinitions.hpp"
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
58{
59
60 Rcpp::class_<Version::FMTversion>("FMTversion", "@DocString(FMTversion)")
61 .constructor("@DocString(FMTversion())")
62 .method("getmajor", &getmajorstaticpass,
63 "@DocString(FMTversion::getmajor)")
64 .method("getminor",&getminorstaticpass,
65 "@DocString(FMTversion::getminor)")
66 .method("getpatch", &getpatchstaticpass,
67 "@DocString(FMTversion::getpatch)")
68 .method("getversion", &getversionstaticpass,
69 "@DocString(FMTversion::getversion)")
70 .method("isatleast", &isatleaststaticpass,
71 "@DocString(FMTversion::isatleast)")
72 .method("hasfeature", &hasfeaturestaticpass,
73 "@DocString(FMTversion::hasfeature)")
74 .method("getlicense",&getlicensestaticpass,
75 "@DocString(FMTversion::getlicense)");
76 }
77}
78
79
80#endif // PYEXPORTVERSION_H_INCLUDED
81
RCPP_EXPOSED_AS(Version::FMTversion)
RCPP_EXPOSED_WRAP(Version::FMTversion)
Definition: FMTversion.hpp:42
static std::string getversion()
static std::string getlicense(bool french=false)
static bool hasfeature(const std::string &name)
static int getpatch()
static int getmajor()
static int getminor()
static bool isatleast(int major, int minor, int patch)
Definition: RexportCore.hpp:153
std::string getversionstaticpass(Version::FMTversion *versionobject)
Definition: RexportVersion.hpp:36
bool isatleaststaticpass(Version::FMTversion *versionobject, int major, int minor, int patch)
Definition: RexportVersion.hpp:41
int getminorstaticpass(Version::FMTversion *versionobject)
Definition: RexportVersion.hpp:26
int getmajorstaticpass(Version::FMTversion *versionobject)
Definition: RexportVersion.hpp:21
int getpatchstaticpass(Version::FMTversion *versionobject)
Definition: RexportVersion.hpp:31
std::string getlicensestaticpass(Version::FMTversion *versionobject, bool french)
Definition: RexportVersion.hpp:51
bool hasfeaturestaticpass(Version::FMTversion *versionobject, const std::string &feature)
Definition: RexportVersion.hpp:46
void exportVersion()
Definition: RexportVersion.hpp:57