1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef EXCHANGEPLUGIN_VALIDATORS_H
22 #define EXCHANGEPLUGIN_VALIDATORS_H
24 #include "ExchangePlugin.h"
25 #include <ModelAPI_AttributeValidator.h>
28 * \class ExchangePlugin_FormatValidator
30 * \brief Validator for the imported formats checking
32 * The configuration file of import/export features contains the information
33 * about which formats are supported and the extension of the associated files.
34 * This validator filters out files that are out of this description.
36 class ExchangePlugin_FormatValidator : public ModelAPI_AttributeValidator
39 * Parses input arguments "BREP:BREPImport", "STEP|STP:STEPImport"
40 * into list of file formats "BREP","STEP","STP"
41 * and list of corresponding plugins: "BREPImport", "STEPImport"
43 static bool parseFormats(const std::list<std::string>& theArguments,
44 std::list<std::string>& outFormats);
47 * Returns true is the file-name attribute correctly corresponds to the set of
50 virtual bool isValid(const AttributePtr& theAttribute,
51 const std::list<std::string>& theArguments,
52 Events_InfoMessage& theError) const;
56 * \class ExchangePlugin_ImportFormatValidator
58 * \brief Validator for the import format.
60 class ExchangePlugin_ImportFormatValidator : public ExchangePlugin_FormatValidator
66 * \class ExchangePlugin_ExportFormatValidator
68 * \brief Validator for the export format.
70 class ExchangePlugin_ExportFormatValidator : public ExchangePlugin_FormatValidator