00001 /*************************************************************************** 00002 * Copyright (C) 2006-2008 by Antonello Lobianco * 00003 * http://regmas.org * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 3 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 #ifndef INPUTNODE_H 00021 #define INPUTNODE_H 00022 00023 #include <iostream> 00024 #include <cstdlib> 00025 00026 #include <string> 00027 #include <sstream> 00028 #include <stdexcept> 00029 #include <list> 00030 #include <vector> 00031 00032 #include <QDomElement> 00033 00034 //regmas headers... 00035 #include "BaseRegmas.h" 00036 00037 using namespace std; 00038 00039 //class QDomElement; 00040 00042 00049 class InputNode: public BaseRegmas{ 00050 00051 public: 00052 InputNode(); 00053 InputNode(QDomElement domElement_h){domElement=domElement_h;}; //<Constructor 00054 ~InputNode(); 00055 bool setWorkingFile (std::string filename_h); 00056 int getIntContent(); 00057 double getDoubleContent(); 00058 string getStringContent(); 00059 bool getBoolContent(); 00060 int getIntAttributeByName(string attributeName_h); 00061 double getDoubleAttributeByName(string attributeName_h); 00062 string getStringAttributeByName(string attributeName_h); 00063 bool hasAttributeByName(string attributeName_h); 00064 InputNode getNodeByName (string nodeName_h, int debugLevel=MSG_CRITICAL_ERROR, bool childFlag=false); 00065 vector <InputNode> getNodesByName (string nodeName_h, int debugLevel=MSG_WARNING, bool childFlag=false); 00066 00067 //InputNode getNode(string nodeName_h, string attributeName_h="", string attributeValue_h="", int debugLevel=MSG_WARNING); 00069 //vector <InputNode> getNodes(string nodeName_h, string attributeName_h="", string attributeValue_h="", int debugLevel=MSG_WARNING); 00070 00071 00072 vector <InputNode> getChildNodes(); 00073 bool hasChildNode(string name_h); 00074 int getChildNodesCount(); 00075 string getNodeName(); 00076 00077 private: 00078 QDomElement domElement; 00079 00080 }; 00081 00082 #endif