X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConfig%2FConfig_FeatureReader.h;h=e3d1098f9e8e419dd3a41765474610186dc058d6;hb=95ff1008bc8215fdeafd7d253dc5a6f33e949363;hp=7b5322bba036468272244794f370455f610c1fdb;hpb=ec70f37d26f584bdd46983837b01407429f29478;p=modules%2Fshaper.git diff --git a/src/Config/Config_FeatureReader.h b/src/Config/Config_FeatureReader.h index 7b5322bba..e3d1098f9 100644 --- a/src/Config/Config_FeatureReader.h +++ b/src/Config/Config_FeatureReader.h @@ -1,41 +1,73 @@ -/* - * Config_FeatureReader.h - * - * Created on: Mar 20, 2014 - * Author: sbh - */ +// Copyright (C) 2014-2021 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 class Config_FeatureMessage; -class Config_FeatureReader: public Config_XMLReader +/*! + * \class Config_FeatureReader + * \ingroup Config + * \brief Class to process feature's xml definition. + */ +class Config_FeatureReader : public Config_XMLReader { -public: + public: + /// Constructor Config_FeatureReader(const std::string& theXmlFile, - const std::string& theLibraryName = "", + const std::string& theLibraryName, + const std::string& theDocSection = std::string(), 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); - void fillFeature(xmlNodePtr theRoot, Config_FeatureMessage& outFeatureMessage); + /// Overloaded method. Clears attribute cache on exit from attribute's node + virtual void cleanup(xmlNodePtr aNode); -private: - std::string myLastWorkbench; - std::string myLastGroup; + /// 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); + + private: std::string myLibraryName; - /// event generated on feature data sending, by default it is "FeatureEvent" + std::string myLibraryDocSection; + + std::list myFeatures; + /// event generated on feature data sending, by default it is Config_FeatureMessage::GUI_EVENT() const char* myEventGenerated; + bool myIsProcessWidgets; }; #endif /* CONFIG_FEATUREREADER_H_ */