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