// sizedBuffer.h: interface for the sizedBuffer class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SIZEDBUFFER_H__94F01DA0_F09C_46E6_BE65_F9F98A7909B4__INCLUDED_)
#define AFX_SIZEDBUFFER_H__94F01DA0_F09C_46E6_BE65_F9F98A7909B4__INCLUDED_

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

class sizedBuffer
{
public:
	sizedBuffer();
	sizedBuffer( const unsigned char* buf, int size, int ref );

	sizedBuffer( const sizedBuffer & );
	virtual ~sizedBuffer();
	int size() const;
	const unsigned char * data() const;
	int ref( void ) const;

	sizedBuffer & operator=( const sizedBuffer & in );
	friend bool operator==( const sizedBuffer & left, const sizedBuffer & right );

	unsigned char operator[]( int ) const;
private:
	unsigned char * m_buf;
	int m_size;
	int m_ref;
	void doCopy( const sizedBuffer & in );
};


#endif // !defined(AFX_SIZEDBUFFER_H__94F01DA0_F09C_46E6_BE65_F9F98A7909B4__INCLUDED_)
