00001 #ifndef DV_STRSTREAM_H 00002 #define DV_STRSTREAM_H 00003 00004 // $Id: strstr2str.h,v 1.13 2002/10/18 11:41:26 dvermeir Exp $ 00005 00006 /** \mainpage 00007 00008 \author dvermeir@vub.ac.be 00009 00010 <a href="../download/">Download</a> 00011 00012 \section Installation Installation 00013 00014 Standard. See the INSTALL file in the top directory. 00015 00016 \section Introduction Introduction 00017 00018 This package provides some general utilities, see the ``Compound 00019 List'' and ``Namespace Members'' entries on the top menubar. 00020 00021 */ 00022 00023 /** \file 00024 Utility functions for safe conversion of an {o}strstream to 00025 a string (unfreezes the {o}strstream, so that memory is released 00026 upon its destruction). Not very useful, once {o}stringstream is 00027 available: 00028 <ul> 00029 <li> Dv::Util::strstream2str(strstream&) 00030 <li> Dv::Util::strstream2str(ostrstream&) 00031 <li> Dv::Util::strstream2str(strstream&,string&) 00032 <li> Dv::Util::strstream2str(ostrstream&,string&) 00033 </ul> 00034 */ 00035 00036 #include <string> 00037 #include <strstream> 00038 00039 /** Namespace for all dvxyz packages. */ 00040 namespace Dv { 00041 /** Dv::Util is the namepace for this package. */ 00042 namespace Util { 00043 /** Safely convert ss to string */ 00044 std::string strstream2str(std::strstream& ss); 00045 /** Safely convert ss to string */ 00046 std::string strstream2str(std::ostrstream& ss); 00047 00048 // The next 2 functions return a reference to their 2nd argument. 00049 00050 /** Safely convert ss to string s, return s. */ 00051 std::string& strstream2str(std::strstream& ss,std::string &s); 00052 /** Safely convert ss to string s, return s. */ 00053 std::string& strstream2str(std::ostrstream& ss,std::string& s); 00054 }} 00055 #endif
dvutil-0.13.15 | [30 December, 2004] |