mirror of
https://github.com/ModOrganizer2/modorganizer-plugin_python.git
synced 2026-07-27 14:03:33 -07:00
Test for FileTypes (and QFlags).
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#include "pybind11_qt/pybind11_qt.h"
|
||||
|
||||
#include <pybind11/functional.h>
|
||||
#include <pybind11/pybind11.h>
|
||||
|
||||
#include "ifiletree.h"
|
||||
|
||||
using namespace MOBase;
|
||||
|
||||
PYBIND11_MODULE(filetree, m)
|
||||
{
|
||||
// test the FileTypes stuff
|
||||
m.def("is_file", [](IFileTree::FileTypes const& t) {
|
||||
return t.testFlag(IFileTree::FILE);
|
||||
});
|
||||
m.def("is_directory", [](IFileTree::FileTypes const& t) {
|
||||
return t.testFlag(IFileTree::DIRECTORY);
|
||||
});
|
||||
m.def("value", [](IFileTree::FileTypes const& t) {
|
||||
return t.toInt();
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user