Mantid
Loading...
Searching...
No Matches
StringContainsValidator.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
9
10#include <boost/python/class.hpp>
11#include <boost/python/default_call_policies.hpp>
12#include <boost/python/list.hpp>
13#include <boost/python/make_constructor.hpp>
14
18using namespace boost::python;
19
20namespace {
21StringContainsValidator *createStringContainsValidator() { return new StringContainsValidator(); }
22
23StringContainsValidator *createStringContainsValidatorWithStrings(const boost::python::list &values) {
25}
26
28void setRequiredStrings(StringContainsValidator &self, const boost::python::list &strs) {
30}
31} // namespace
32
34 class_<StringContainsValidator, bases<IValidator>, boost::noncopyable>("StringContainsValidator")
35 .def("__init__", make_constructor(&createStringContainsValidator, default_call_policies()))
36 .def("__init__",
37 make_constructor(&createStringContainsValidatorWithStrings, default_call_policies(), (arg("values"))))
38 .def("setRequiredStrings", &setRequiredStrings, arg("Strings"),
39 "Set the list of sub strings that the input must contain");
40}
void export_StringContainsValidator()
IValidator is the basic interface for all validators for properties.
Definition: IValidator.h:43
StringContainsValidator : A validator designed to ensure that a string input contain a given sub stri...
void setRequiredStrings(const std::vector< std::string > &)
Allows a for a vector of required strings to be passed to the validator.
Converts a Python sequence type to a C++ std::vector, where the element type is defined by the templa...