📄 buffer.h
字号:
//
// Buffer.h
//
// Copyright (c) Shareaza Development Team, 2002-2004.
// This file is part of SHAREAZA (www.shareaza.com)
//
// Shareaza 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.
//
// Shareaza is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Shareaza; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
#pragma once
class CBuffer
{
// Construction
public:
CBuffer(DWORD* pLimit = NULL);
virtual ~CBuffer();
// Attributes
public:
CBuffer* m_pNext;
BYTE* m_pBuffer;
DWORD m_nLength;
DWORD m_nBuffer;
// Operations
public:
void Add(const void* pData, DWORD nLength);
void Insert(DWORD nOffset, const void* pData, DWORD nLength);
void Remove(DWORD nLength);
void Clear();
void Print(LPCSTR pszText);
void Print(LPCWSTR pszText, UINT nCodePage = CP_ACP);
DWORD AddBuffer(CBuffer* pBuffer, DWORD nLength = 0xFFFFFFFF);
void AddReversed(const void* pData, DWORD nLength);
void Prefix(LPCSTR pszText);
void EnsureBuffer(DWORD nLength);
public:
CString ReadString(DWORD nBytes, UINT nCodePage = CP_ACP);
BOOL ReadLine(CString& strLine, BOOL bPeek = FALSE, UINT nCodePage = CP_ACP);
BOOL StartsWith(LPCSTR pszString, BOOL bRemove = FALSE);
DWORD Receive(SOCKET hSocket);
DWORD Send(SOCKET hSocket);
BOOL Deflate(BOOL bIfSmaller = FALSE);
BOOL Inflate(DWORD nSuggest = 0);
BOOL Ungzip();
void WriteDIME(DWORD nFlags, LPCSTR pszID, LPCSTR pszType, LPCVOID pBody, DWORD nBody);
BOOL ReadDIME(DWORD* pnFlags, CString* psID, CString* psType, DWORD* pnBody);
public:
static void ReverseBuffer(const void* pInput, void* pOutput, DWORD nLength);
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -