Salome HOME
Add ExchangeAPI, fillAttribute in ModelHighAPI_Tools, ModelHighAPI_Selection and...
[modules/shaper.git] / src / ExchangePlugin / ExchangePlugin_Validators.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:    ExchangePlugin_Validators.h
4 // Created: Aug 01, 2014
5 // Author:  Sergey BELASH
6
7 #ifndef EXCHANGEPLUGIN_VALIDATORS_H
8 #define EXCHANGEPLUGIN_VALIDATORS_H
9
10 #include "ExchangePlugin.h"
11 #include <ModelAPI_AttributeValidator.h>
12
13 /**
14  * \class ExchangePlugin_FormatValidator
15  * \ingroup Validators
16  * \brief Validator for the imported formats checking
17  *
18  * The configuration file of import/export features contains the information
19  * about which formats are supported and the extension of the associated files.
20  * This validator filters out files that are out of this description.
21  */
22 class ExchangePlugin_FormatValidator : public ModelAPI_AttributeValidator
23 {
24   /**
25    * Parses input arguments "BREP:BREPImport", "STEP|STP:STEPImport"
26    * into list of file formats "BREP","STEP","STP"
27    * and list of corresponding plugins: "BREPImport", "STEPImport"
28    */
29   static bool parseFormats(const std::list<std::string>& theArguments,
30                            std::list<std::string>& outFormats);
31 public:
32   /**
33    * Returns true is the file-name attribute correctly corresponds to the set of
34    * allowed formats.
35    */
36   virtual bool isValid(const AttributePtr& theAttribute,
37                        const std::list<std::string>& theArguments,
38                        std::string& theError) const;
39 };
40
41 /**
42  * \class ExchangePlugin_ImportFormatValidator
43  * \ingroup Validators
44  * \brief Validator for the import format.
45  */
46 class ExchangePlugin_ImportFormatValidator : public ExchangePlugin_FormatValidator
47 {
48
49 };
50
51 /**
52  * \class ExchangePlugin_ExportFormatValidator
53  * \ingroup Validators
54  * \brief Validator for the export format.
55  */
56 class ExchangePlugin_ExportFormatValidator : public ExchangePlugin_FormatValidator
57 {
58
59 };
60
61 #endif