www.pudn.com > GGBT.rar > Bdecode.h


// Bdecode.h: interface for the CBdecode class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_BDECODE_H__5C53A746_81D4_4013_9897_2D2A44C4FAAA__INCLUDED_) 
#define AFX_BDECODE_H__5C53A746_81D4_4013_9897_2D2A44C4FAAA__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
#include "val.h" 
#include "memstream.h" 
 
 
 
class CBdecode   
{ 
public: 
	CBdecode(); 
	virtual ~CBdecode(); 
	 
	static void bencode(CVal* pVal, memstream& memRet); 
	CVal* bdecode(char* pbuf, long lsize); 
 
private: 
	static void bencode_rec(CVal* pVal, memstream& strRet); 
	CVal* decode_int(long& lPos); 
	CVal* decode_string(long& lPos); 
	CVal* decode_list(long& lPos); 
	CVal* decode_dict(long& lPos); 
	CVal* bdecode_rec(long& lPos); 
	 
	long m_lsize; 
	char* m_pBuf; 
}; 
 
#endif // !defined(AFX_BDECODE_H__5C53A746_81D4_4013_9897_2D2A44C4FAAA__INCLUDED_)