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

📄 databuffer.h

📁 Windows CE操作系统中适用的蓝牙驱动程序
💻 H
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
// DataBuffer.h: interface for the DataBuffer class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_DATABUFFER_H__E030F2AE_6CC6_11D3_80A5_00C04F61171F__INCLUDED_)
#define AFX_DATABUFFER_H__E030F2AE_6CC6_11D3_80A5_00C04F61171F__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#ifndef __WINDOWS__
#include <windows.h>
#endif

#pragma pack(4)
class DataBuffer  
{
public:
												DataBuffer(DWORD initialsize);
	virtual										~DataBuffer();

	DataBuffer									&operator=(DataBuffer &rhs);

	void										WriteData(BYTE *buf, DWORD size);
	DWORD										ReadData(BYTE *buf, DWORD size);
	void										DropData(DWORD size);
	DWORD										ReadData(DataBuffer *db,DWORD size);

	DWORD										DataAvailable();
	DWORD										GetEmptySpace();
	
	void										Flush();
	void										ResetBuffer();

	BYTE										Peek(DWORD pos);
	BYTE										*c_ptr(DWORD pos, DWORD validbytes);

protected:
	DWORD										GetContentSize();
	BOOL										IncreaseBuffer(DWORD size);


protected:
	BYTE										*mBuffer;
	DWORD										mTotalSize;
	DWORD										mWritePos;
	DWORD										mReadPos;

};

#endif // !defined(AFX_DATABUFFER_H__E030F2AE_6CC6_11D3_80A5_00C04F61171F__INCLUDED_)

⌨️ 快捷键说明

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