9#include <Poco/Exception.h>
40 if (!Poco::Path().tryParse(
value)) {
41 return "Error in path syntax: \"" +
value +
"\".";
47 if (
value.empty() || !Poco::File(
value).exists())
48 return "Directory \"" +
value +
"\" not found";
49 if (!Poco::File(
value).isDirectory())
50 return "Directory \"" +
value +
"\" specified is actually a file";
51 }
catch (Poco::FileException &) {
52 return "Error accessing directory \"" +
value +
"\"";
double value
The value of the point.
IValidator_sptr clone() const override
Clone the validator.
DirectoryValidator(bool testDirectoryExists=true)
Constructor.
std::vector< std::string > allowedValues() const override
Returns the set of valid values.
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.
FileValidator is a validator that checks that a filepath is valid.
bool m_testExist
Flag indicating whether to test for existence of filename.
std::shared_ptr< IValidator > IValidator_sptr
A shared_ptr to an IValidator.