X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConfig%2FConfig_FeatureReader.h;h=7986f3b59e3f8ea62efbcf78f20343e54d2a4ac0;hb=60e95a5502a6940c6c27ce5d561b3c684b0b0a4f;hp=468cb9911165f8c09faa902d6d0b55c23f317b53;hpb=dc4b9ee9f5445b39bcaeb3b7f05627774e343ffa;p=modules%2Fshaper.git diff --git a/src/Config/Config_FeatureReader.h b/src/Config/Config_FeatureReader.h index 468cb9911..7986f3b59 100644 --- a/src/Config/Config_FeatureReader.h +++ b/src/Config/Config_FeatureReader.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + /* * Config_FeatureReader.h * @@ -10,37 +12,56 @@ #include #include +#include #include #include +#include class Config_FeatureMessage; -class Config_FeatureReader: public Config_XMLReader +/*! + * \class Config_FeatureReader + * \brief Class to process feature's xml definition. + */ +class Config_FeatureReader : public Config_XMLReader { -public: + public: Config_FeatureReader(const std::string& theXmlFile, const std::string& theLibraryName, const char* theEventGenerated = 0); virtual ~Config_FeatureReader(); - + /// Returns list of all features defined in reader's file std::list features() const; -protected: - void processNode(xmlNodePtr aNode); - bool processChildren(xmlNodePtr aNode); + protected: + /// Overloaded method. Defines how to process each node + virtual void processNode(xmlNodePtr aNode); + /// Overloaded method. Defines if the given node should be parsed recursively + virtual bool processChildren(xmlNodePtr aNode); + + /// Fills feature message + void fillFeature(xmlNodePtr theRoot, + const std::shared_ptr& outFeatureMessage); - void fillFeature(xmlNodePtr theRoot, Config_FeatureMessage& outFeatureMessage); - bool isInternalFeature(xmlNodePtr theRoot); + /// Stores an attribute in internal map for later use. + /// Key is "Node_Name:Node_Attribute" and value is getProperty(theNodeAttribute) + void storeAttribute(xmlNodePtr theNode, const char* theNodeAttribute); + /// Restores an attribute from internal map. + std::string restoreAttribute(xmlNodePtr theNode, const char* theNodeAttribute); + /// Restores an attribute from internal map. + std::string restoreAttribute(const char* theNodeName, const char* theNodeAttribute); -private: - std::string myLastWorkbench; - std::string myLastGroup; + private: + /// A map to store all parent's attributes. + /// The key has from "Node_Name:Node_Attribute" + std::map myParentAttributes; std::string myLibraryName; std::list myFeatures; - /// event generated on feature data sending, by default it is EVENT_FEATURE_LOADED + /// event generated on feature data sending, by default it is Config_FeatureMessage::GUI_EVENT() const char* myEventGenerated; + bool myIsProcessWidgets; }; #endif /* CONFIG_FEATUREREADER_H_ */