00001 #if !defined(_MEMBUFFER_HPP) 00002 #define _MEMBUFFER_HPP 00003 //============================================================================= 00004 // 00005 // XDFLengine library 00006 // 00007 //----------------------------------------------------------------------------- 00008 // MEMBUFFER.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/xmlstreambuffer.hpp" 00044 00045 BEGIN_XDFLENGINE_NS 00046 00047 //============================================================================= 00048 // CLASS MEMBUFFER 00049 //----------------------------------------------------------------------------- 00051 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00052 class XDFLENGINE_EXPORT MemBuffer: public XMLStreamBuffer 00053 { 00054 00055 private: //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00056 00057 void* m_bBuf; 00058 unsigned int m_uiBufSize; 00059 int m_intSize; 00060 00061 public: //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00062 00063 //_____________________________________________________________________ 00064 // MEMBUFFER 00065 //--------------------------------------------------------------------- 00068 //_____________________________________________________________________ 00069 MemBuffer (); 00070 00071 //_____________________________________________________________________ 00072 // ~MEMBUFFER 00073 //--------------------------------------------------------------------- 00076 //_____________________________________________________________________ 00077 ~MemBuffer (); 00078 00079 00080 // XMLSTREAMPROVIDER 00081 00082 //_____________________________________________________________________ 00083 // OPERATOR >> 00084 //--------------------------------------------------------------------- 00085 virtual XMLStreamProvider & operator>> ( XMLStreamConsumer& p_pStreamConsumer); 00086 00087 // XMLSTREAMCONSUMER 00088 00089 //_____________________________________________________________________ 00090 // WRITEDATA 00091 //--------------------------------------------------------------------- 00092 //_____________________________________________________________________ 00093 void writeData( const char* p_pszData, unsigned int p_uiDataLen); 00094 00095 // MEMBUFFER 00096 00097 //_____________________________________________________________________ 00098 // FLUSH 00099 //--------------------------------------------------------------------- 00101 //_____________________________________________________________________ 00102 void flush (); 00103 00104 //_____________________________________________________________________ 00105 // LENGTH 00106 //--------------------------------------------------------------------- 00109 //_____________________________________________________________________ 00110 int length () const; 00111 00112 00113 //_____________________________________________________________________ 00114 // DATA 00115 //--------------------------------------------------------------------- 00116 const char* data() const; 00117 00118 00119 00120 }; 00121 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00122 //============================================================================= 00123 00124 END_XDFLENGINE_NS 00125 00126 #endif 00127