Salome HOME
Issue #818 - Deletion of a parameter used in a feature -- Replace parameters
[modules/shaper.git] / src / ParametersPlugin / ParametersPlugin_Validators.h
index 3a4db55c88a8944bd6ede1e74e2ba600260a70b8..b81b1c92c1a5b0c00628c692159ca8af4d79843f 100644 (file)
@@ -13,7 +13,6 @@
 
 #include <ModelAPI_AttributeValidator.h>
 
-#include <regex>
 #include <memory>
 
 class ParametersPlugin_VariableValidator : public ModelAPI_AttributeValidator
@@ -26,10 +25,13 @@ class ParametersPlugin_VariableValidator : public ModelAPI_AttributeValidator
   //! \param theAttribute the checked attribute
   //! \param theArguments arguments of the attribute
   PARAMETERSPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
-                                               const std::list<std::string>& theArguments) const;
+                                               const std::list<std::string>& theArguments,
+                                               std::string& theError) const;
 
- private:
-  std::regex myPyVariableRegex;
+ protected:
+  PARAMETERSPLUGIN_EXPORT bool isVariable(const std::string& theString) const;
+  PARAMETERSPLUGIN_EXPORT bool isUnique(const AttributePtr& theAttribute, 
+                                        const std::string& theString) const;
 };
 
 class ParametersPlugin_ExpressionValidator: public ModelAPI_AttributeValidator
@@ -42,7 +44,8 @@ class ParametersPlugin_ExpressionValidator: public ModelAPI_AttributeValidator
   //! \param theAttribute the checked attribute
   //! \param theArguments arguments of the attribute
   PARAMETERSPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
-                                               const std::list<std::string>& theArguments) const;
+                                               const std::list<std::string>& theArguments,
+                                               std::string& theError) const;
 };