/* * FilePresentValidator.hpp * * Created on: May 9, 2012 * Author: heber */ #ifndef FILEPRESENTVALIDATOR_HPP_ #define FILEPRESENTVALIDATOR_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include "Parameters/Validators/DummyValidator.hpp" /** This validator checks whethet the file via the given path is present. * */ class FilePresentValidator : public Validator< boost::filesystem::path > { bool isValid(const boost::filesystem::path & _value) const { return boost::filesystem::exists(_value); } bool operator==(const Validator &_instance) const { const FilePresentValidator *inst = dynamic_cast(&_instance); if (inst) return true; else return false; } Validator< boost::filesystem::path >* clone() const { Validator< boost::filesystem::path > *inst = new FilePresentValidator(); return inst; } }; #endif /* FILEPRESENTVALIDATOR_HPP_ */