X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FExchangePlugin%2FExchangePlugin_Validators.h;h=61613f35e50004742b7e535883d66b7905fb92f8;hb=6da8c412d0102f5997e2af9734edf23627daf937;hp=c4400fc9f24d14b076be2fe306ca31f354f6af38;hpb=b97f4d67421685f99412ee79484c7a8482da1d2e;p=modules%2Fshaper.git diff --git a/src/ExchangePlugin/ExchangePlugin_Validators.h b/src/ExchangePlugin/ExchangePlugin_Validators.h index c4400fc9f..61613f35e 100644 --- a/src/ExchangePlugin/ExchangePlugin_Validators.h +++ b/src/ExchangePlugin/ExchangePlugin_Validators.h @@ -1,6 +1,8 @@ -// File: SketchPlugin_Validators.h -// Created: 01 Aug 2014 -// Author: Vitaly SMETANNIKOV +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + +// File: ExchangePlugin_Validators.h +// Created: Aug 01, 2014 +// Author: Sergey BELASH #ifndef EXCHANGEPLUGIN_VALIDATORS_H #define EXCHANGEPLUGIN_VALIDATORS_H @@ -8,12 +10,51 @@ #include "ExchangePlugin.h" #include -class ExchangePlugin_ImportFormatValidator : public ModelAPI_AttributeValidator +/** + * \class ExchangePlugin_FormatValidator + * \ingroup Validators + * \brief Validator for the imported formats checking + * + * The configuration file of import/export features contains the information + * about which formats are supported and the extension of the associated files. + * This validator filters out files that are out of this description. + */ +class ExchangePlugin_FormatValidator : public ModelAPI_AttributeValidator { - public: - virtual bool isValid(const FeaturePtr& theFeature, + /** + * Parses input arguments "BREP:BREPImport", "STEP|STP:STEPImport" + * into list of file formats "BREP","STEP","STP" + * and list of corresponding plugins: "BREPImport", "STEPImport" + */ + static bool parseFormats(const std::list& theArguments, + std::list& outFormats); +public: + /** + * Returns true is the file-name attribute correctly corresponds to the set of + * allowed formats. + */ + virtual bool isValid(const AttributePtr& theAttribute, const std::list& theArguments, - const ObjectPtr& theObject) const; + Events_InfoMessage& theError) const; +}; + +/** + * \class ExchangePlugin_ImportFormatValidator + * \ingroup Validators + * \brief Validator for the import format. + */ +class ExchangePlugin_ImportFormatValidator : public ExchangePlugin_FormatValidator +{ + +}; + +/** + * \class ExchangePlugin_ExportFormatValidator + * \ingroup Validators + * \brief Validator for the export format. + */ +class ExchangePlugin_ExportFormatValidator : public ExchangePlugin_FormatValidator +{ };