00001 #if !defined(_XMLSTREAMER_HPP) 00002 #define _XMLSTREAMER_HPP 00003 //============================================================================= 00004 // 00005 // XDFLengine library 00006 // 00007 //----------------------------------------------------------------------------- 00008 // XMLSTREAMER.HPP 00009 //----------------------------------------------------------------------------- 00015 //_____________________________________________________________________________ 00016 // 00017 // Copyright (C) 2003 Guillaume Baurand. All Rights Reserved. 00018 // 00019 // This file is part of the XDFLengine project. 00020 // 00021 // The XDFLengine is free software; you can redistribute it and/or modify 00022 // it under the terms of the GNU General Public License as published by 00023 // the Free Software Foundation; either version 2 of the License, or 00024 // (at your option) any later version. 00025 // 00026 // This program is distributed in the hope that it will be useful, 00027 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00028 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00029 // GNU General Public License for more details. 00030 // 00031 // You should have received a copy of the GNU General Public License 00032 // along with this program; if not, write to the Free Software 00033 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 00034 // USA. 00035 // 00036 // For more information, 00037 // contact : guillaume@baurand.net 00038 // or visit : http://xdflengine.sourceforge.net 00039 // 00040 //============================================================================= 00041 00042 # include "config/commonincs.hpp" 00043 # include "flow/xmlstreamconsumer.hpp" 00044 00045 BEGIN_XDFLENGINE_NS 00046 00047 class XMLStreamerFactory; 00048 class XMLFlowContext; 00049 typedef VAarray< char*> StreamerParams; 00050 00051 //============================================================================= 00052 // CLASS XMLStreamer 00053 //----------------------------------------------------------------------------- 00057 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00058 class XDFLENGINE_EXPORT XMLStreamer : public XMLStreamConsumer 00059 { 00060 00061 protected: 00062 00063 const XMLStreamerFactory* m_pParent; 00064 StreamerParams* m_pParameters; 00065 XMLFlowContext* m_pContext; 00066 XMLStreamConsumer* m_pOutput; 00067 00068 public: 00069 00070 // STATICS 00071 00072 //_____________________________________________________________________ 00073 // GETPARAMVALUE 00074 //--------------------------------------------------------------------- 00080 //_____________________________________________________________________ 00081 static const char* getParamValue( StreamerParams* p_pParameters, const char* p_pszParamName, const char* p_pszParamDefault = 0); 00082 00083 // CONTRUCTOR & DESTRUCTOR 00084 00085 //_____________________________________________________________________ 00086 // XMLSTREAMER 00087 //--------------------------------------------------------------------- 00093 //_____________________________________________________________________ 00094 XMLStreamer( const XMLStreamerFactory* p_pParent, StreamerParams* p_pParameters, XMLFlowContext* p_pContext, XMLStreamConsumer* p_pOutput); 00095 00096 //_____________________________________________________________________ 00097 // XMLSTREAMER 00098 //--------------------------------------------------------------------- 00100 //_____________________________________________________________________ 00101 virtual ~XMLStreamer(); 00102 00103 // STREAM 00104 00105 //_____________________________________________________________________ 00106 // INITSTREAM 00107 //--------------------------------------------------------------------- 00112 //_____________________________________________________________________ 00113 virtual bool initStream(); 00114 00115 //_____________________________________________________________________ 00116 // WRITEDATA 00117 //--------------------------------------------------------------------- 00123 //_____________________________________________________________________ 00124 virtual void writeData( const char* p_pszData, unsigned int p_uiDataLen); 00125 00126 //_____________________________________________________________________ 00127 // COMMITSTREAM 00128 //--------------------------------------------------------------------- 00137 //_____________________________________________________________________ 00138 virtual bool commitStream( bool p_fFinal=false); 00139 }; 00140 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00141 //============================================================================= 00142 00143 END_XDFLENGINE_NS 00144 00145 #endif 00146