UniSet  2.2.1
Restorer.h
См. документацию.
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 <memory>
00029 #include <sigc++/sigc++.h>
00030 #include <string>
00031 #include "UniXML.h"
00032 #include "UniSetTypes.h"
00033 // --------------------------------------------------------------------------
00039 class Restorer_XML
00040 {
00041     public:
00042 
00043         Restorer_XML();
00044         virtual ~Restorer_XML();
00045 
00052         typedef sigc::slot<bool, const std::shared_ptr<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 
00102         static xmlNode* find_node( const std::shared_ptr<UniXML>& xml, xmlNode* root, const std::string& nodename, const std::string& nm = "" );
00103 
00104     protected:
00105 
00106         virtual bool check_list_item( UniXML::iterator& it );
00107         virtual bool check_consumer_item( UniXML::iterator& it );
00108 
00109         ReaderSlot rslot;
00110         ReaderSlot cslot;
00111 
00112         std::string i_filterField;
00113         std::string i_filterValue;
00114         std::string c_filterField;
00115         std::string c_filterValue;
00116 };
00117 // --------------------------------------------------------------------------
00118 #endif
00119 // --------------------------------------------------------------------------