First public contribution.
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #include <ups/cliententity.h>
20 #include <ups/upserr.h>
22 using namespace UserPromptService;
25 EXPORT_C CClientEntity* CClientEntity::NewL(const TDesC8& aName)
27 Creates a new client entity object.
28 @param aName A name that uniquely identifies the entity within the context
29 of the client process.
30 @return A pointer to the new client entity object.
33 CClientEntity* self = CClientEntity::NewLC(aName);
34 CleanupStack::Pop(self);
38 EXPORT_C CClientEntity* CClientEntity::NewLC(const TDesC8& aName)
40 Creates a new client entity object and places the pointer on the cleanup stack.
41 @param aName A name that uniquely identifies the entity within the context
42 of the client process.
43 @return A pointer to the new client entity object.
46 CClientEntity* self = new(ELeave) CClientEntity();
47 CleanupStack::PushL(self);
48 self->ConstructL(aName);
52 void CClientEntity::ConstructL(const TDesC8& aName)
54 Second phase constructor
55 @param aClientEntityName A descriptor containing the name of the client entity.
58 if (aName.Length() > KUpsMaxClientEntityLength)
60 User::Leave(KErrUpsBadClientEntityLength);
62 iName = aName.AllocL();
65 EXPORT_C const TDesC8& CClientEntity::Name() const
67 Gets the unique name for the client entity.
68 @return A descriptor containing the client entity name.
74 CClientEntity::CClientEntity()
81 CClientEntity::~CClientEntity()