stringstream.h

来自「Amis - A maximum entropy estimator 一个最大」· C头文件 代码 · 共 76 行

H
76
字号
////////////////////////////////////////////////////////////////////////////  Copyright (c) 2000, Yusuke Miyao///  You may distribute under the terms of the Artistic License.//////  <id>$Id: StringStream.h,v 1.4 2003/04/24 08:29:36 kazama Exp $///  <collection>Maximum Entropy Estimator</collection>///  <name>StringStream.h</name>///  <overview>Wrapper class for stringstream</overview>///  <desc>///  This file provides a wrapper class for stringstream.///  When stringstream is not installed, strstream is used.///  </desc>/////////////////////////////////////////////////////////////////////////#ifndef Amis_StringStream_h_#define Amis_StringStream_h_#include <amis/configure.h>#ifdef HAVE_SSTREAM#include <sstream>#else // HAVE_SSTREAM#include <strstream>#endif // HAVE_SSTREAM#include <iostream>AMIS_NAMESPACE_BEGIN#ifdef HAVE_SSTREAMclass IStringStream : public std::istringstream{	public:	IStringStream( const char* s ) : std::istringstream( s ) { }	IStringStream( const std::string& s ) : std::istringstream( s ) { }};#elseclass IStringStream : public std::istrstream{	public:	IStringStream( const char* s ) : std::istrstream( s ) { }	IStringStream( const std::string& s ) : std::istrstream( s ) { }};#endifclass OStringStream : #ifdef HAVE_SSTREAMpublic std::ostringstream#elsepublic std::ostrstream#endif{public:  OStringStream( void ) {}  ~OStringStream() {#ifndef HAVE_SSTREAM    freeze( false );#endif // HAVE_SSTREAM  }#ifndef HAVE_SSTREAMpublic:  std::string str( void ) {    (*this) << std::ends;    return std::string( std::ostrstream::str() );  }#endif // HAVE_SSTREAM};AMIS_NAMESPACE_END#endif // Amis_StringStream_h_// end of StringStream.h

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?