xml_strx.h

Go to the documentation of this file.
00001 #ifndef __XML_STRX_H
00002 #define __XML_STRX_H
00003 
00004 #include "mimasconfig.h"
00005 
00006 #ifdef HAVE_XALAN
00007 
00008 #include <iostream>
00009 #include <util/XercesDefs.hpp>
00010 #include <util/XMLString.hpp>
00011 #include <Include/PlatformDefinitions.hpp>
00012 
00013 #ifdef XERCES_HAS_CPP_NAMESPACE
00014 using namespace XERCES_CPP_NAMESPACE;
00015 #endif
00016 #ifdef XALAN_HAS_CPP_NAMESPACE
00017 using namespace XALAN_CPP_NAMESPACE;
00018 #endif
00019 
00020 namespace mimas {
00021 
00029 template <class To, class From>
00030 class xml_strx
00031 {
00032 public:
00035   xml_strx( const From *_buffer )
00036      { buffer = XMLString::transcode( _buffer ); }
00038   xml_strx( const xml_strx<To,From> &_strX ):
00039     buffer( XMLString::replicate( _strX.buffer ) ) {}
00042   virtual ~xml_strx(void) { free( buffer ); }
00045   int getLength(void) const
00046   { return XMLString::stringLen( buffer ); }
00049   int getSize(void) const { return ( getLength() + 1 ) * sizeof(To); }
00052   const To *getBuffer() const { return buffer; }
00053 protected:
00055   To *buffer;
00056 };
00057 
00061 template <class To, class From>
00062 inline std::ostream& operator<<( std::ostream& target,
00063                                  const xml_strx<To,From> &toDump)
00064 {
00065   target << toDump.getBuffer();
00066   return target;
00067 }
00068 
00070 
00071 };
00072 
00073 #endif
00074 
00075 #endif

[GNU/Linux] [Qt] [Mesa] [STL] [Lapack] [Boost] [Magick++] [Xalan-C and Xerces-C] [doxygen] [graphviz] [FFTW] [popt] [xine] [Gnuplot] [gnu-arch] [gcc] [gstreamer] [autoconf/automake/make] [freshmeat.net] [opensource.org] [sourceforge.net] [MMVL]
mimas 2.1 - Copyright Mon Oct 30 11:31:17 2006, Bala Amavasai, Stuart Meikle, Arul Selvan, Fabio Caparrelli, Jan Wedekind, Manuel Boissenin, ...