Mantid
|
FileValidator is a validator that checks that a filepath is valid. More...
#include <FileValidator.h>
Public Member Functions | |
std::vector< std::string > | allowedValues () const override |
Returns the set of valid values. More... | |
IValidator_sptr | clone () const override |
Clone the validator. More... | |
FileValidator (const std::vector< std::string > &extensions=std::vector< std::string >(), bool testFileExists=true) | |
Constructor. More... | |
Protected Attributes | |
std::vector< std::string > | m_extensions |
The list of permitted extensions. More... | |
bool | m_testExist |
Flag indicating whether to test for existence of filename. More... | |
Private Member Functions | |
std::string | checkValidity (const std::string &value) const override |
If m_fullTest=true if checks that the files exists, otherwise just that path syntax looks valid. More... | |
bool | endswith (const std::string &value) const |
Checks the extension of a filename. More... | |
FileValidator is a validator that checks that a filepath is valid.
Definition at line 25 of file FileValidator.h.
|
explicit |
Constructor.
extensions | :: The permitted file extensions (e.g. .RAW) |
testFileExists | :: Flag indicating whether to test for existence of file (default: yes) |
Definition at line 28 of file FileValidator.cpp.
References m_extensions.
|
override |
Returns the set of valid values.
Definition at line 39 of file FileValidator.cpp.
References m_extensions.
Referenced by Mantid::Kernel::MultiFileValidator::allowedValues().
|
overrideprivate |
If m_fullTest=true if checks that the files exists, otherwise just that path syntax looks valid.
value | :: file name |
Definition at line 52 of file FileValidator.cpp.
References Mantid::Kernel::Logger::debug(), endswith(), error, Mantid::DataHandling::exists(), Mantid::Kernel::DateAndTimeHelpers::g_log, m_extensions, m_testExist, and value.
|
override |
Clone the validator.
Definition at line 45 of file FileValidator.cpp.
|
private |
Checks the extension of a filename.
value | :: the filename to check |
Definition at line 122 of file FileValidator.cpp.
References Mantid::Kernel::has_ending(), m_extensions, and value.
Referenced by checkValidity().
|
protected |
The list of permitted extensions.
Definition at line 34 of file FileValidator.h.
Referenced by allowedValues(), checkValidity(), endswith(), and FileValidator().
|
protected |
Flag indicating whether to test for existence of filename.
Definition at line 36 of file FileValidator.h.
Referenced by Mantid::Kernel::DirectoryValidator::checkValidity(), checkValidity(), and Mantid::Kernel::DirectoryValidator::DirectoryValidator().