00001 /* 00002 webEngine is the HTML processing library 00003 Copyright (C) 2009 Andrew Abramov aabramov@ptsecurity.ru 00004 00005 This file is part of webEngine 00006 00007 webEngineis free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 webEngineis distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with webEngine. If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 #ifndef __WEHELPER_H__ 00021 #define __WEHELPER_H__ 00022 00035 #include "weiBase.h" 00036 #include "weStrings.h" 00037 #include "weHtmlEntity.h" 00038 #include "weiTransport.h" 00039 00040 typedef WeHtmlEntity* (*EntityFactory)(iweEntity* prnt); 00041 typedef iweTransport* (*TransportFactory)(); 00042 00043 // typedef WeLinkedListElem<string, EntityFactory> WeHtmlFuncList; 00044 // typedef WeLinkedListElem<string, TransportFactory> WeTranspFuncList; 00045 00054 class WeHtmlFactory : public WeLinkedList<string, EntityFactory> 00055 { 00056 public: 00057 WeHtmlFactory(); 00058 void Init(); 00059 void Add(string name, EntityFactory func); 00060 WeHtmlEntity* CreateEntity(string tagName, WeHtmlEntity* prnt); 00061 }; 00062 00071 class WeTransportFactory : public WeLinkedList<string, TransportFactory> 00072 { 00073 public: 00074 WeTransportFactory(); 00075 void Init(); 00076 void Add(string name, TransportFactory func); 00077 iweTransport* CreateTransport(string tagName); 00078 }; 00079 00089 class WeError : public runtime_error 00090 { 00091 public: 00092 00099 WeError(string const& msg) 00100 : runtime_error(string("WebEngine error") + (msg.empty() ? "" : ": ") + msg) 00101 { 00102 LOG4CXX_ERROR(WeLogger::GetLogger(), "WebEngine error" << (msg.empty() ? "" : ": ") << msg ) 00103 } 00104 }; 00105 00106 00107 00108 extern WeHtmlFactory weHtmlFactory; 00109 extern WeTransportFactory weTransportFactory; 00110 00111 void WeLibInit(void); 00112 void WeLibClose(void); 00113 00114 #endif //__WEHELPER_H__
©2009 Positive Technologies |
Generated on Tue Jul 14 18:27:30 2009 for WebEngine by |
|
1.5.7 |
|