1 #ifndef OUTPUTSTRINGSTREAM_H
2 #define OUTPUTSTRINGSTREAM_H
4 #include "zipios++/zipios-config.h"
6 #include "zipios++/meta-iostreams.h"
11 #if defined (HAVE_STD_IOSTREAM) && defined (USE_STD_IOSTREAM)
13 typedef std::ostringstream OutputStringStream ;
17 /** OutputStringStream is typedefed to ostringstream if sstream is
18 part of the standard library (unless Zipios++ has been explicitly
19 configured not to use it). If sstream is not present
20 OutputStringStream is a subclass of ostrstream from
21 strstream.h. In this case OutputStringStream specializes the str()
22 method, such that the caller does not have to concern himself with
23 null-terminating the string and unfreezing the ostrstream. */
24 class OutputStringStream : public ostrstream {
27 /** Specialization of ostrstream::str() that takes care of
28 null-terminating the string and unfreezing the ostrstream. */
30 *this << ends ; // null terminate ostrstream
31 string o_str( ostrstream::str() ) ;
36 // To avoid invoking such a member function in the base
37 // class if there is one!
49 Header file that defines OutputStringStream.
53 Zipios++ - a small C++ library that provides easy access to .zip files.
54 Copyright (C) 2000 Thomas Søndergaard
56 This library is free software; you can redistribute it and/or
57 modify it under the terms of the GNU Lesser General Public
58 License as published by the Free Software Foundation; either
59 version 2 of the License, or (at your option) any later version.
61 This library is distributed in the hope that it will be useful,
62 but WITHOUT ANY WARRANTY; without even the implied warranty of
63 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
64 Lesser General Public License for more details.
66 You should have received a copy of the GNU Lesser General Public
67 License along with this library; if not, write to the Free Software
68 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA