// UB_UTL.CPP
//
// Copyright (c) 1994-1999 Symbian Ltd.  All rights reserved.
//

#include "ub_std.h"

GLDEF_C void Panic(TBasePanic aPanic)
//
// Panic the process with E32USER-ADT as the category.
//
	{

	User::Panic(Category(),aPanic);
	}

GLDEF_C const TPtrC Category()
//
// Return ADT as the category.
//
	{

	return(_L("E32USER-CBase"));
	}

EXPORT_C CBase::CBase()
//
// Constructor.
//
	{
	}

EXPORT_C CBase::~CBase()
//
// Destructor.
//
	{
	}

EXPORT_C TAny *CBase::operator new(TUint aSize)
//
// Allocate memory and fill with zeroes.
//
	{

	TAny *pM=User::Alloc(aSize);
	if (pM)
		Mem::FillZ(pM,aSize);
	return(pM);
	}

EXPORT_C TAny *CBase::operator new(TUint aSize,TLeave /*aType*/)
//
// Allocate memory and fill with zeroes. Leave on any error.
//
	{

	TAny *pM=User::AllocL(aSize);
	Mem::FillZ(pM,aSize);
	return(pM);
	}

EXPORT_C TAny *CBase::operator new(TUint aSize,TUint anExtraSize)
//
// Allocate memory and fill with zeroes.
//
	{

	aSize+=anExtraSize;
	TAny *pM=User::Alloc(aSize);
	if (pM)
		Mem::FillZ(pM,aSize);
	return(pM);
	}

EXPORT_C CConsoleBase *Console::NewL(const TDesC &aTitle,TSize aSize)
//
// Create a new console object.
//
	{

	CConsoleBase *pC=(CConsoleBase *)NewConsole();
	User::LeaveIfNull(pC);
	TInt r=pC->Create(aTitle,aSize);
	if (r!=KErrNone)
		{
		delete pC;
		User::Leave(r);
		}
	return(pC);
	}

