UniSet
1.4.0
|
00001 /* This file is part of the UniSet project 00002 * Copyright (c) 2002 Free Software Foundation, Inc. 00003 * Copyright (c) 2002 Pavel Vainerman 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 2 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 Free Software 00017 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 */ 00019 // -------------------------------------------------------------------------- 00024 // -------------------------------------------------------------------------- 00025 #ifndef Restorer_H_ 00026 #define Restorer_H_ 00027 // -------------------------------------------------------------------------- 00028 #include <sigc++/sigc++.h> 00029 #include <string> 00030 #include "UniXML.h" 00031 #include "UniSetTypes.h" 00032 // -------------------------------------------------------------------------- 00039 class Restorer_XML 00040 { 00041 public: 00042 00043 Restorer_XML(); 00044 virtual ~Restorer_XML(); 00045 00052 typedef sigc::slot<bool,UniXML&,UniXML_iterator&,xmlNode*> ReaderSlot; 00053 00065 void setReadItem( ReaderSlot sl ); 00066 00067 00080 void setReadConsumerItem( ReaderSlot sl ); 00081 00082 00086 void setItemFilter( const std::string filterField, const std::string filterValue="" ); 00087 00091 void setConsumerFilter( const std::string filterField, const std::string filterValue="" ); 00092 00093 00098 bool getConsumerInfo( UniXML_iterator& it, 00099 UniSetTypes::ObjectId& cid, UniSetTypes::ObjectId& cnode ); 00100 00105 bool old_getConsumerInfo( UniXML_iterator& it, 00106 UniSetTypes::ObjectId& cid, UniSetTypes::ObjectId& cnode ); 00107 00108 00109 00111 static xmlNode* find_node( UniXML& xml, xmlNode* root, const std::string& nodename, const std::string nm="" ); 00112 00113 protected: 00114 00115 virtual bool check_list_item( UniXML_iterator& it ); 00116 virtual bool check_consumer_item( UniXML_iterator& it ); 00117 00118 ReaderSlot rslot; 00119 ReaderSlot cslot; 00120 00121 std::string i_filterField; 00122 std::string i_filterValue; 00123 std::string c_filterField; 00124 std::string c_filterValue; 00125 }; 00126 // -------------------------------------------------------------------------- 00127 #endif 00128 // --------------------------------------------------------------------------