12#include <boost/python/bases.hpp>
13#include <boost/python/class.hpp>
14#include <boost/python/default_call_policies.hpp>
15#include <boost/python/enum.hpp>
16#include <boost/python/make_constructor.hpp>
17#include <boost/python/overloads.hpp>
26 bpl::enum_<FileProperty::FileAction>(
"FileAction")
47FileProperty *createFileProperty(
const std::string &name,
const std::string &defaultValue,
unsigned int action,
48 const bpl::object &extensions = bpl::object(),
50 std::vector<std::string> extsAsVector;
52 bpl::extract<std::string> extractor(extensions);
53 if (extractor.check()) {
54 extsAsVector = std::vector<std::string>(1, extractor());
59 return new FileProperty(name, defaultValue, action, extsAsVector, direction);
64 bpl::class_<FileProperty, bpl::bases<PropertyWithValue<std::string>>, boost::noncopyable>(
"FileProperty",
66 .def(
"__init__", bpl::make_constructor(&createFileProperty, bpl::default_call_policies(),
67 (bpl::arg(
"name"), bpl::arg(
"defaultValue"), bpl::arg(
"action"),
68 bpl::arg(
"extensions") = bpl::object(),
void export_FileProperty()
A specialized class for dealing with file properties.
@ Directory
to specify a directory that must exist
@ OptionalSave
to specify a file to write to but an empty string is
@ OptionalLoad
to specify a file to read but the file doesn't have to exist
@ OptionalDirectory
to specify a directory that does not have to exist
@ Save
to specify a file to write to, the file may or may not exist
@ Load
allowed here which will be passed to the algorithm
The concrete, templated class for properties.
bool isNone(PyObject *ptr)
@ Input
An input workspace.
Converts a Python sequence type to a C++ std::vector, where the element type is defined by the templa...