FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
PYexportVersion.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 PYEXPORTVERSION_H_INCLUDED
9#define PYEXPORTVERSION_H_INCLUDED
10
11#include <boost/python/docstring_options.hpp>
12#include <boost/python/args.hpp>
13#include "FMTVersion.h"
14#include "boost/python.hpp"
15
16
17namespace Python
18{
19BOOST_PYTHON_FUNCTION_OVERLOADS(getlicense_overloads, Version::FMTVersion::getLicense, 0, 1)
20BOOST_PYTHON_FUNCTION_OVERLOADS(getchangelog_overloads, Version::FMTVersion::getChangelog, 0, 1)
21
23{
24 namespace bp = boost::python;
25 bp::object SpatialModule(bp::handle<>(bp::borrowed(PyImport_AddModule("FMT.Version"))));
26 bp::scope().attr("Version") = SpatialModule;
27 bp::scope Spatial_scope = SpatialModule;
28 bp::scope().attr("__doc__") = ".. module:: Version\n"
29 "\n"
30 " :platform: Unix, Windows\n"
31 " :synopsis: Version module.\n"
32 "\n";
33
34
35 boost::python::class_<Version::FMTVersion>("FMTversion", "@DocString(FMTVersion)")
36 .def("getmajor", &Version::FMTVersion::getMajor,
37 "@DocString(FMTVersion::getmajor)").staticmethod("getmajor")
38 .def("getminor",&Version::FMTVersion::getMinor,
39 "@DocString(FMTVersion::getminor)").staticmethod("getminor")
40 .def("getpatch", &Version::FMTVersion::getPatch,
41 "@DocString(FMTVersion::getpatch)").staticmethod("getpatch")
42 .def("getversion", &Version::FMTVersion::getVersion,
43 "@DocString(FMTVersion::getversion)").staticmethod("getversion")
44 .def("isatleast", &Version::FMTVersion::isAtLeast,
45 "@DocString(FMTVersion::isatleast)").staticmethod("isatleast")
46 .def("hasfeature", &Version::FMTVersion::hasFeature,
47 "@DocString(FMTVersion::hasfeature)").staticmethod("hasfeature")
48 .def("getlicense",&Version::FMTVersion::getLicense,
49 getlicense_overloads(bp::args("french"),"@DocString(FMTVersion::getlicense)")).staticmethod("getlicense")
50 .def("getchangelog",&Version::FMTVersion::getChangelog,
51 getchangelog_overloads(bp::args("french"),"@DocString(FMTVersion::getchangelog)")).staticmethod("getchangelog");
52 }
53}
54
55
56#endif // PYEXPORTVERSION_H_INCLUDED
57
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: PYdefinitions.h:14
void exportVersion()
Definition: PYexportVersion.h:22
Namespace for handling FMT versions and features.
Definition: FMTVersion.h:31