📄 stream.cpp
字号:
/*************************************************************************** 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;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -