sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // LogPackage.h sl@0: // sl@0: // sl@0: sl@0: #include "logpackage.h" sl@0: sl@0: // Constants sl@0: const TInt KLogPackageGranuality = 0x200; sl@0: sl@0: sl@0: CLogPackage::CLogPackage() sl@0: : iPtr(NULL, 0) sl@0: { sl@0: } sl@0: sl@0: EXPORT_C CLogPackage::~CLogPackage() sl@0: { sl@0: delete iBuffer; sl@0: } sl@0: sl@0: void CLogPackage::ConstructL() sl@0: { sl@0: iBuffer = CBufFlat::NewL(KLogPackageGranuality); sl@0: } sl@0: sl@0: EXPORT_C CLogPackage* CLogPackage::NewL() sl@0: { sl@0: CLogPackage* self = new(ELeave)CLogPackage; sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: EXPORT_C void CLogPackage::SetLogEventL(const CLogEvent& aEvent) sl@0: { sl@0: RBufWriteStream stream(*iBuffer); sl@0: stream << aEvent; sl@0: stream.CommitL(); sl@0: } sl@0: sl@0: EXPORT_C void CLogPackage::GetLogEventL(CLogEvent& aEvent) const sl@0: { sl@0: RBufReadStream stream(*iBuffer); sl@0: stream >> aEvent; sl@0: } sl@0: sl@0: EXPORT_C void CLogPackage::SetLogEventTypeL(const CLogEventType& aType) sl@0: { sl@0: RBufWriteStream stream(*iBuffer); sl@0: stream << aType; sl@0: stream.CommitL(); sl@0: } sl@0: sl@0: EXPORT_C void CLogPackage::GetLogEventTypeL(CLogEventType& aType) const sl@0: { sl@0: RBufReadStream stream(*iBuffer); sl@0: stream >> aType; sl@0: } sl@0: sl@0: EXPORT_C void CLogPackage::SetLogConfigL(const TLogConfig& aConfig) sl@0: { sl@0: RBufWriteStream stream(*iBuffer); sl@0: stream << aConfig; sl@0: stream.CommitL(); sl@0: } sl@0: sl@0: EXPORT_C void CLogPackage::GetLogConfigL(TLogConfig& aConfig) const sl@0: { sl@0: RBufReadStream stream(*iBuffer); sl@0: stream >> aConfig; sl@0: } sl@0: sl@0: EXPORT_C void CLogPackage::SetLogFilterListL(const CLogFilterList& aFilterList) sl@0: { sl@0: RBufWriteStream stream(*iBuffer); sl@0: aFilterList.ExternalizeL(stream); sl@0: stream.CommitL(); sl@0: } sl@0: sl@0: EXPORT_C void CLogPackage::GetLogFilterListL(CLogFilterList& aFilterList) const sl@0: { sl@0: RBufReadStream stream(*iBuffer); sl@0: aFilterList.InternalizeL(stream); sl@0: }