sl@0: // Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32\euser\us_hand.cpp sl@0: // sl@0: // sl@0: sl@0: #include "us_std.h" sl@0: sl@0: sl@0: _LIT(KLiteralMatchAny, "*"); sl@0: sl@0: EXPORT_C TFindHandleBase::TFindHandleBase() sl@0: : iMatch(KLiteralMatchAny) sl@0: /** sl@0: Default constructor. sl@0: sl@0: The default constructed TFindHandleBase object has the default match pattern, i.e. sl@0: the single character "*". sl@0: */ sl@0: { sl@0: } sl@0: sl@0: sl@0: sl@0: sl@0: EXPORT_C TFindHandleBase::TFindHandleBase(const TDesC& aMatch) sl@0: : iMatch(aMatch) sl@0: /** sl@0: Constructor with match pattern. sl@0: sl@0: This constructor creates a TFindHandleBase object with the specified match sl@0: pattern. sl@0: sl@0: @param aMatch A reference to the descriptor containing the match pattern. sl@0: */ sl@0: { sl@0: } sl@0: sl@0: sl@0: sl@0: sl@0: EXPORT_C void TFindHandleBase::Find(const TDesC& aMatch) sl@0: /** sl@0: Sets a new match pattern. sl@0: sl@0: On return from this function, this TFindHandleBase object contains a copy sl@0: of the supplied match pattern; the source descriptor can, therefore, be safely sl@0: discarded. sl@0: sl@0: @param aMatch A reference to the descriptor containing the new match pattern. sl@0: */ sl@0: { sl@0: sl@0: Reset(); sl@0: iMatch=aMatch; sl@0: } sl@0: sl@0: /** sl@0: Implementation for TFindXxxxxxx::Next(TFullName &aResult) methods sl@0: @internalComponent sl@0: */ sl@0: TInt TFindHandleBase::NextObject(TFullName& aResult, TInt aObjectType) sl@0: { sl@0: TBuf8 match8; sl@0: match8.Copy(iMatch); sl@0: TInt r = Exec::ObjectNext((TObjectType)aObjectType, match8, *this); sl@0: if (r==KErrNone) sl@0: { sl@0: aResult.Copy(match8); sl@0: } sl@0: return r; sl@0: } sl@0: sl@0: EXPORT_C void RHandleBase::SetHandleNC(TInt aHandle) sl@0: /** sl@0: Sets the handle-number of this handle to the specified sl@0: value, and marks it as not closable. sl@0: sl@0: @param aHandle The handle-number to be set. sl@0: */ sl@0: { sl@0: SetHandle(aHandle|CObjectIx::ENoClose); sl@0: }