⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gstream.h

📁 一个非常有用的开源代码
💻 H
字号:
/*	Copyright (C) 2006, Mike Gashler	This library is free software; you can redistribute it and/or	modify it under the terms of the GNU Lesser General Public	License as published by the Free Software Foundation; either	version 2.1 of the License, or (at your option) any later version.	see http://www.gnu.org/copyleft/lesser.html*/#ifndef __GSTREAM_H__#define __GSTREAM_H__// This works with a circular bufferclass GStream{protected:	unsigned char* m_pBuff;	unsigned int m_nBufferSize;	unsigned int m_nDataSize;	unsigned int m_nBufferPos;	unsigned int m_nDataPos;	bool m_bWritePermission;public:	GStream(const void* pBuff, unsigned int nBufferSize, unsigned int nUsedSize, bool bWritePermission);	virtual ~GStream();	unsigned char Peek(unsigned int nOffset); // see what's coming	unsigned int Eat(unsigned int nSize); // like Read, but doesn't give you any data	unsigned int Write(const void* pBuff, unsigned int nSize); // returns the size actually written	unsigned int Read(void* pBuff, unsigned int nSize); // returns the size actually read	unsigned int GetCount() { return m_nDataPos; } // How many bytes have been read or eaten	unsigned int GetSize() { return m_nDataSize; } // How much is left in the stream to read or eat};#endif // __GSTREAM_H__

⌨️ 快捷键说明

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