// DIMEOptions.cpp: implementation of the DIMEOptions class.
//
//
//////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2002 Robert Cunnings. All rights reserved.
//
// You may copy, modify, distribute or publish this code free of charge.
//
// NO WARRANTY: This software is provided AS IS, without warranty of any kind.
//
//////////////////////////////////////////////////////////////////////
//
// DIMEOptions class - a class for encapsulating zero or more DIME "options".
// 
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "DIMEOptions.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

DIMEOption::DIMEOption()
{
	m_ulElementType = 0;
	m_ulElementLength = 0;
	m_pData = NULL;
}

DIMEOption::DIMEOption( unsigned long ulType,
						unsigned long ulLength,
						unsigned char *pData)
{
	m_ulElementType = ulType;
	m_ulElementLength = ulLength;
	if (ulLength > 0)
	{
		m_pData = (unsigned char *)malloc(ulLength);
		if (m_pData != NULL)
		{
			memcpy(m_pData, pData, ulLength);
		}
	}
}

DIMEOption::~DIMEOption()
{
	if (m_pData != NULL)
	{
		free(m_pData);
	}
}

