Salome HOME
Add copyright header according to request of CEA from 06.06.2017
[modules/shaper.git] / src / ExchangePlugin / ExchangePlugin_Validators.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef EXCHANGEPLUGIN_VALIDATORS_H
22 #define EXCHANGEPLUGIN_VALIDATORS_H
23
24 #include "ExchangePlugin.h"
25 #include <ModelAPI_AttributeValidator.h>
26
27 /**
28  * \class ExchangePlugin_FormatValidator
29  * \ingroup Validators
30  * \brief Validator for the imported formats checking
31  *
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.
35  */
36 class ExchangePlugin_FormatValidator : public ModelAPI_AttributeValidator
37 {
38   /**
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"
42    */
43   static bool parseFormats(const std::list<std::string>& theArguments,
44                            std::list<std::string>& outFormats);
45 public:
46   /**
47    * Returns true is the file-name attribute correctly corresponds to the set of
48    * allowed formats.
49    */
50   virtual bool isValid(const AttributePtr& theAttribute,
51                        const std::list<std::string>& theArguments,
52                        Events_InfoMessage& theError) const;
53 };
54
55 /**
56  * \class ExchangePlugin_ImportFormatValidator
57  * \ingroup Validators
58  * \brief Validator for the import format.
59  */
60 class ExchangePlugin_ImportFormatValidator : public ExchangePlugin_FormatValidator
61 {
62
63 };
64
65 /**
66  * \class ExchangePlugin_ExportFormatValidator
67  * \ingroup Validators
68  * \brief Validator for the export format.
69  */
70 class ExchangePlugin_ExportFormatValidator : public ExchangePlugin_FormatValidator
71 {
72
73 };
74
75 #endif