?? shoppingitem.cpp
字號:
/* Copyright (c) 2004, Nokia. All rights reserved */
// INCLUDE FILES
#include <s32file.h>
#include <e32std.h>
#include "shoppingitem.h"
// ================= MEMBER FUNCTIONS =======================
// ---------------------------------------------------------
// CShoppingItem::NewL()
// Creates an instance of the CShoppingItem class.
// ---------------------------------------------------------
//
CShoppingItem* CShoppingItem::NewL()
{
CShoppingItem* self = CShoppingItem::NewLC();
CleanupStack::Pop( self );
return self;
}
// ---------------------------------------------------------
// CShoppingItem::NewLC()
// Creates an instance of the CShoppingItem class.
// ---------------------------------------------------------
//
CShoppingItem* CShoppingItem::NewLC()
{
CShoppingItem* self = new ( ELeave ) CShoppingItem;
CleanupStack::PushL( self );
self->ConstructL();
return self;
}
// ---------------------------------------------------------
// CShoppingItem::CShoppingItem()
// Constructor
// ---------------------------------------------------------
//
CShoppingItem::CShoppingItem()
{
// No implementation required
}
// ---------------------------------------------------------
// CShoppingItem::~CShoppingItem()
// Destructor
// ---------------------------------------------------------
//
CShoppingItem::~CShoppingItem()
{
delete iName;
iName = NULL;
}
// ---------------------------------------------------------
// CShoppingItem::ConstructL()
// 2nd phase construction.
// ---------------------------------------------------------
//
void CShoppingItem::ConstructL()
{
// No implementation required
}
// ---------------------------------------------------------
// CShoppingItem::ExternalizeL()
// 2nd phase construction.
// ---------------------------------------------------------
//
void CShoppingItem::ExternalizeL( RWriteStream& aStream ) const
{
if ( iName )
{
aStream << *iName;
}
else
{
aStream << KNullDesC;
}
aStream.WriteInt32L( iFlags );
}
// ---------------------------------------------------------
// CShoppingItem::InternalizeL()
// 2nd phase construction.
// ---------------------------------------------------------
//
void CShoppingItem::InternalizeL( RReadStream& aStream )
{
delete iName;
iName = HBufC::NewL( aStream, KMaxTInt );
iFlags = aStream.ReadInt32L();
}
// ---------------------------------------------------------
// CShoppingItem::SetNameL()
// ---------------------------------------------------------
//
void CShoppingItem::SetNameL( HBufC* aValue )
{
delete iName;
iName = aValue;
}
// ---------------------------------------------------------
// CShoppingItem::Name()
// ---------------------------------------------------------
//
HBufC* CShoppingItem::Name() const
{
return iName;
}
// ---------------------------------------------------------
// CShoppingItem::SetFlags()
// ---------------------------------------------------------
//
void CShoppingItem::SetFlags( TUint aValue )
{
iFlags = aValue;
}
// ---------------------------------------------------------
// CShoppingItem::Flags()
// ---------------------------------------------------------
//
TUint CShoppingItem::Flags() const
{
return iFlags;
}
// End of File
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -