Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
Mantid::Kernel::MultiFileValidator Class Reference

The MultiFileValidator validates a MultiFileProperty, which contains a vector of vectors* of filenames - the meaning of which is discussed in MultiFileProperty.h. More...

#include <MultiFileValidator.h>

Inheritance diagram for Mantid::Kernel::MultiFileValidator:

Public Member Functions

std::vector< std::string > allowedValues () const override
 Returns the set of allowed extensions. More...
 
IValidator_sptr clone () const override
 Clone the validator. More...
 
 MultiFileValidator ()
 Default constructor. More...
 
 MultiFileValidator (const MultiFileValidator &mfv)
 Copy constructor. More...
 
 MultiFileValidator (const std::vector< std::string > &extensions, bool testFilesExist=true)
 Constructor. More...
 
MultiFileValidatoroperator= (MultiFileValidator)
 

Protected Attributes

FileValidator m_fileValidator
 FileValidator instance used for validating multiple files. More...
 

Private Member Functions

std::string checkValidity (const std::vector< std::vector< std::string > > &values) const override
 Returns an error if at least one of the files is not valid, else "". More...
 

Friends

void swap (MultiFileValidator &obj1, MultiFileValidator &obj2)
 

Detailed Description

The MultiFileValidator validates a MultiFileProperty, which contains a vector of vectors* of filenames - the meaning of which is discussed in MultiFileProperty.h.

This is essentially a wrapper around the FileValidator class; a single instance of which is called, once for each filename.

Definition at line 29 of file MultiFileValidator.h.

Constructor & Destructor Documentation

◆ MultiFileValidator() [1/3]

Mantid::Kernel::MultiFileValidator::MultiFileValidator ( )

Default constructor.

Definition at line 18 of file MultiFileValidator.cpp.

◆ MultiFileValidator() [2/3]

Mantid::Kernel::MultiFileValidator::MultiFileValidator ( const std::vector< std::string > &  extensions,
bool  testFilesExist = true 
)
explicit

Constructor.

Parameters
extensions:: The permitted file extensions (e.g. .RAW)
testFilesExist:: If to check if files exist

Definition at line 41 of file MultiFileValidator.cpp.

◆ MultiFileValidator() [3/3]

Mantid::Kernel::MultiFileValidator::MultiFileValidator ( const MultiFileValidator mfv)

Copy constructor.

Parameters
mfv:: The object with which to construct this object.

Definition at line 24 of file MultiFileValidator.cpp.

Member Function Documentation

◆ allowedValues()

std::vector< std::string > Mantid::Kernel::MultiFileValidator::allowedValues ( ) const
override

Returns the set of allowed extensions.

Returns the set of valid values.

Definition at line 45 of file MultiFileValidator.cpp.

References Mantid::Kernel::FileValidator::allowedValues(), and m_fileValidator.

◆ checkValidity()

std::string Mantid::Kernel::MultiFileValidator::checkValidity ( const std::vector< std::vector< std::string > > &  values) const
overrideprivate

Returns an error if at least one of the files is not valid, else "".

Checks that the files exist.

The filenames of any files that dont exist are returned in an error message, else the message is "".

Parameters
values:: a vector of vectors of file names
Returns
An error message to display to users or an empty string on no error

Definition at line 59 of file MultiFileValidator.cpp.

References error, and m_fileValidator.

◆ clone()

IValidator_sptr Mantid::Kernel::MultiFileValidator::clone ( ) const
override

Clone the validator.

Returns
A pointer to a new validator with the same properties as this one

Definition at line 51 of file MultiFileValidator.cpp.

◆ operator=()

MultiFileValidator & Mantid::Kernel::MultiFileValidator::operator= ( MultiFileValidator  tmp)

Definition at line 32 of file MultiFileValidator.cpp.

References swap, and tmp.

Friends And Related Function Documentation

◆ swap

void swap ( MultiFileValidator obj1,
MultiFileValidator obj2 
)
friend

Definition at line 27 of file MultiFileValidator.cpp.

Referenced by operator=().

Member Data Documentation

◆ m_fileValidator

FileValidator Mantid::Kernel::MultiFileValidator::m_fileValidator
protected

FileValidator instance used for validating multiple files.

Definition at line 46 of file MultiFileValidator.h.

Referenced by allowedValues(), and checkValidity().


The documentation for this class was generated from the following files: