X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConfig%2FConfig_FeatureReader.h;h=de2c96ca9237c5a08f332480fd9fff9ec5d971b4;hb=893048d62e837075ea3253c89ce9ecdfbb7a0cf3;hp=92a9d705fc630b2bc17ce1d5b387eb8a40e89c3f;hpb=52558a1594f889f73337ed79f402a236e0f9b482;p=modules%2Fshaper.git diff --git a/src/Config/Config_FeatureReader.h b/src/Config/Config_FeatureReader.h index 92a9d705f..de2c96ca9 100644 --- a/src/Config/Config_FeatureReader.h +++ b/src/Config/Config_FeatureReader.h @@ -1,55 +1,72 @@ -/* - * Config_FeatureReader.h - * - * Created on: Mar 20, 2014 - * Author: sbh - */ +// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or +// email : webmaster.salome@opencascade.com +// #ifndef CONFIG_FEATUREREADER_H_ #define CONFIG_FEATUREREADER_H_ #include #include -#include +#include #include #include -#include class Config_FeatureMessage; +/*! + * \class Config_FeatureReader + * \ingroup Config + * \brief Class to process feature's xml definition. + */ class Config_FeatureReader : public Config_XMLReader { public: - Config_FeatureReader(const std::string& theXmlFile, const std::string& theLibraryName, + /// Constructor + 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); + /// Overloaded method. Defines how to process each node + virtual void processNode(xmlNodePtr aNode); + + /// Overloaded method. Clears attribute cache on exit from attribute's node + virtual void cleanup(xmlNodePtr aNode); - void fillFeature(xmlNodePtr theRoot, - const boost::shared_ptr& outFeatureMessage); - bool isInternalFeature(xmlNodePtr theRoot); + /// Overloaded method. Defines if the given node should be parsed recursively + virtual bool processChildren(xmlNodePtr aNode); - void storeAttribute(xmlNodePtr theNode, const char* theNodeAttribute); - std::string restoreAttribute(xmlNodePtr theNode, const char* theNodeAttribute); - std::string restoreAttribute(const char* theNodeName, const char* theNodeAttribute); + /// Fills feature message + void fillFeature(xmlNodePtr theRoot, + const std::shared_ptr& outFeatureMessage); private: - /// A map to store all parent's attributes. - /// The key has from "Node_Name:Node_Attribute" - std::map myParentAttributes; - //std::string myLastWorkbench; - //std::string myLastGroup; 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_ */