?? stream.cpp
字號(hào):
/*************************************************************************** stream.cpp - description ------------------- begin : Fri Jul 20 2001 copyright : (C) 2001 by Mark email : alben@yeah.net ***************************************************************************//*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/#include "stream.h"#include "exception.h"void CStream::AllocateBuffer(){ m_pchGetBuf = new char[m_iBufSize]; if (!m_pchGetBuf) throw CMemException("out of memory.", __FILE__, __LINE__); m_pchPutBuf = new char[m_iBufSize]; if(!m_pchPutBuf) { delete [] m_pchGetBuf, m_pchGetBuf = 0; throw CMemException("out of memory.", __FILE__, __LINE__); } clear(); setb(m_pchGetBuf, m_pchGetBuf + m_iBufSize, 0); setg(m_pchGetBuf, m_pchGetBuf + m_iBufSize, m_pchGetBuf + m_iBufSize); setp(m_pchPutBuf, m_pchPutBuf + m_iBufSize);}void CStream::FreeBuffer(){ //flush will be done in the inherited class. if (m_pchGetBuf) delete m_pchGetBuf, m_pchGetBuf = 0; if (m_pchPutBuf) delete m_pchPutBuf, m_pchPutBuf = 0;}int CStream::sync(){ overflow(EOF); return 0;}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -