⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shoppingitem.cpp

📁 Symbian 的购物程序 shoppinglist-vc
💻 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 + -