1 // Copyright (C) 2014-2019 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 email : webmaster.salome@opencascade.com
20 #ifndef EXCHANGEPLUGIN_VALIDATORS_H
21 #define EXCHANGEPLUGIN_VALIDATORS_H
23 #include "ExchangePlugin.h"
24 #include <ModelAPI_AttributeValidator.h>
27 * \class ExchangePlugin_FormatValidator
29 * \brief Validator for the imported formats checking
31 * The configuration file of import/export features contains the information
32 * about which formats are supported and the extension of the associated files.
33 * This validator filters out files that are out of this description.
35 class ExchangePlugin_FormatValidator : public ModelAPI_AttributeValidator
38 * Parses input arguments "BREP:BREPImport", "STEP|STP:STEPImport"
39 * into list of file formats "BREP","STEP","STP"
40 * and list of corresponding plugins: "BREPImport", "STEPImport"
42 static bool parseFormats(const std::list<std::string>& theArguments,
43 std::list<std::string>& outFormats);
46 * Returns true is the file-name attribute correctly corresponds to the set of
49 virtual bool isValid(const AttributePtr& theAttribute,
50 const std::list<std::string>& theArguments,
51 Events_InfoMessage& theError) const;
55 * \class ExchangePlugin_ImportFormatValidator
57 * \brief Validator for the import format.
59 class ExchangePlugin_ImportFormatValidator : public ExchangePlugin_FormatValidator
65 * \class ExchangePlugin_ExportFormatValidator
67 * \brief Validator for the export format.
69 class ExchangePlugin_ExportFormatValidator : public ExchangePlugin_FormatValidator