shoppingitem.cpp
来自「为symbian7.0c操作系统series60系列开发的购物软件」· C++ 代码 · 共 79 行
CPP
79 行
/* Copyright (c) 2003, Nokia. All rights reserved */
#include <s32file.h>
#include <e32std.h>
#include "shoppingitem.h"
CShoppingItem* CShoppingItem::NewL()
{
CShoppingItem* self = CShoppingItem::NewLC();
CleanupStack::Pop(self);
return self;
}
CShoppingItem* CShoppingItem::NewLC()
{
CShoppingItem* self = new (ELeave) CShoppingItem;
CleanupStack::PushL(self);
self->ConstructL();
return self;
}
CShoppingItem::CShoppingItem()
{
// No implementation required
}
CShoppingItem::~CShoppingItem()
{
delete iName;
iName = NULL;
}
void CShoppingItem::ConstructL()
{
// No implementation required
}
void CShoppingItem::ExternalizeL(RWriteStream& aStream) const
{
if (iName)
{
aStream << *iName;
}
else
{
aStream << KNullDesC;
}
aStream.WriteInt32L(iFlags);
}
void CShoppingItem::InternalizeL(RReadStream& aStream)
{
delete iName;
iName = HBufC::NewL(aStream, KMaxTInt);
iFlags = aStream.ReadInt32L();
}
void CShoppingItem::SetNameL(HBufC* aValue)
{
delete iName;
iName = aValue;
}
HBufC* CShoppingItem::Name() const
{
return iName;
}
void CShoppingItem::SetFlags(TUint aValue)
{
iFlags = aValue;
}
TUint CShoppingItem::Flags() const
{
return iFlags;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?