📄 datagram.cpp,v
字号:
head 1.3;access;symbols v1_0:1.1.1.2 xueyw:1.1.1 v111:1.1.1.2 MGuard:1.1.1 arelease:1.1.1.1 avendor:1.1.1;locks; strict;comment @// @;1.3date 2007.08.22.11.14.43; author administrator; state Exp;branches;next 1.2;deltatype text;permissions 644;commitid dac46cc1aa232bb;kopt kv;filename @Datagram.cpp@;1.2date 2007.08.08.13.48.24; author administrator; state Exp;branches;next 1.1;deltatype text;permissions 644;commitid d1446b9c9a86281;kopt kv;filename @Datagram.cpp@;1.1date 2007.07.24.10.59.31; author administrator; state Exp;branches 1.1.1.1;next ;deltatype text;permissions 644;1.1.1.1date 2007.07.24.10.59.31; author administrator; state Exp;branches;next 1.1.1.2;deltatype text;permissions 644;1.1.1.2date 2007.08.22.11.31.31; author administrator; state Exp;branches;next ;deltatype text;permissions 644;commitid 81046cc1e913f93;kopt kv;filename @Datagram.cpp@;desc@@1.3log@pass service center to datagram@text@// Datagram.cpp//// Copyright (c) 2003 Symbian Ltd. All rights reserved.//// CDatagram (implementation)#include "DatagramService.h"EXPORT_C CDatagram* CDatagram::NewL(TDesC& aBuf, const TDesC& aSMSCenter )/** Intended Usage: Static factory constructor. Uses two phase construction and leaves nothing on the CleanupStack. @@param aBuf buffer to fill with incoming data @@returns a new CDatagram instance.*/ { CDatagram* self = new(ELeave) CDatagram(); CleanupStack::PushL(self); self->ConstructL(aBuf, aSMSCenter ); CleanupStack::Pop(); return self; }EXPORT_C CDatagram* CDatagram::NewL(const TDesC& aBuf, const TDesC8& aAddress, const TDesC& aSMSCenter )/** Intended Usage: Static factory constructor. Uses two phase construction and leaves nothing on the CleanupStack. @@param aBuf buffer containing data to send via service @@param aAddress buffer containing datagram service specific outgoing address @@returns a new CDatagram instance.*/ { CDatagram* self = new(ELeave) CDatagram(); CleanupStack::PushL(self); self->ConstructL(aBuf, aSMSCenter ); self->SetAddressL(aAddress); CleanupStack::Pop(); return self; }EXPORT_C CDatagram::~CDatagram()/** Deletes internal HBufC8 buffers.*/ { delete iAddress; delete iSMSCenter; delete iData; }void CDatagram::ConstructL(const TDesC& aBuf, const TDesC& aSMSCenter )/** Second phase of construction. @@param aBuf external buffer. */ { delete iSMSCenter; iSMSCenter = NULL; iSMSCenter = aSMSCenter.AllocL(); iData = aBuf.AllocL(); }EXPORT_C const TDesC8& CDatagram::GetAddress()/** Accessor for the outgoing address information, @@returns reference to outgoing address.*/ { return *iAddress; }EXPORT_C const TDesC& CDatagram::GetSMSCenter()/** Accessor for the outgoing address information, @@returns reference to outgoing address.*/ { return *iSMSCenter; }EXPORT_C void CDatagram::SetAddressL(const TDesC8& aAddress)/** Sets the current outgoing address. @@param aAddress buffer containing datagram service specific outgoing address*/ { delete iAddress; iAddress = NULL; iAddress = aAddress.AllocL(); }EXPORT_C const TDesC& CDatagram::GetData()/** Accessor for incoming message data received from datagram service. @@returns Reference to internal buffer containing service specific incoming data.*/ { return *iData; } EXPORT_C void CDatagram::SetDataL(const TDesC& aData)/** Sets the outgoing data to be send via the datagram service. @@param aData buffer containing data to send via service*/ { delete iData; iData = NULL; iData = aData.AllocL(); }@1.2log@unicode message support (chs)@text@d11 1a11 1EXPORT_C CDatagram* CDatagram::NewL(TDesC& aBuf)d22 1a22 1 self->ConstructL(aBuf);d29 1a29 1EXPORT_C CDatagram* CDatagram::NewL(const TDesC& aBuf, const TDesC8& aAddress)d41 1a41 1 self->ConstructL(aBuf);d55 1d61 1a61 1void CDatagram::ConstructL(const TDesC& aBuf)d67 4d86 10@1.1log@Initial revision@text@d11 1a11 1EXPORT_C CDatagram* CDatagram::NewL(TDesC8& aBuf)d29 1a29 1EXPORT_C CDatagram* CDatagram::NewL(const TDesC8& aBuf, const TDesC8& aAddress)d60 1a60 1void CDatagram::ConstructL(const TDesC8& aBuf)d97 1a97 1EXPORT_C const TDesC8& CDatagram::GetData()d109 1a109 1EXPORT_C void CDatagram::SetDataL(const TDesC8& aData)@1.1.1.1log@no message@text@@1.1.1.2log@no message@text@d11 1a11 1EXPORT_C CDatagram* CDatagram::NewL(TDesC& aBuf, const TDesC& aSMSCenter )d22 1a22 1 self->ConstructL(aBuf, aSMSCenter );d29 1a29 1EXPORT_C CDatagram* CDatagram::NewL(const TDesC& aBuf, const TDesC8& aAddress, const TDesC& aSMSCenter )d41 1a41 1 self->ConstructL(aBuf, aSMSCenter );a54 1 delete iSMSCenter;d60 1a60 1void CDatagram::ConstructL(const TDesC& aBuf, const TDesC& aSMSCenter )a65 4 delete iSMSCenter; iSMSCenter = NULL; iSMSCenter = aSMSCenter.AllocL();a81 10EXPORT_C const TDesC& CDatagram::GetSMSCenter()/** Accessor for the outgoing address information, @@returns reference to outgoing address.*/ { return *iSMSCenter; }d97 1a97 1EXPORT_C const TDesC& CDatagram::GetData()d109 1a109 1EXPORT_C void CDatagram::SetDataL(const TDesC& aData)@
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -