equal
deleted
inserted
replaced
|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Description: |
|
12 // |
|
13 |
|
14 #include "usbdescutils.h" |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent |
|
19 */ |
|
20 |
|
21 /*static*/ CUsbCustomDescriptorParserList* CUsbCustomDescriptorParserList::NewL() |
|
22 { |
|
23 CUsbCustomDescriptorParserList* self = new(ELeave) CUsbCustomDescriptorParserList; |
|
24 return self; |
|
25 } |
|
26 |
|
27 CUsbCustomDescriptorParserList::~CUsbCustomDescriptorParserList() |
|
28 { |
|
29 iParserList.Close(); |
|
30 } |
|
31 |
|
32 void CUsbCustomDescriptorParserList::RegisterParserL(UsbDescriptorParser::TUsbDescriptorParserL aParserFunc) |
|
33 { |
|
34 iParserList.AppendL(aParserFunc); |
|
35 } |
|
36 |
|
37 void CUsbCustomDescriptorParserList::UnregisterParser(UsbDescriptorParser::TUsbDescriptorParserL aParserFunc) |
|
38 { |
|
39 TInt res = iParserList.Find(aParserFunc); |
|
40 if(res != KErrNotFound) |
|
41 { |
|
42 iParserList.Remove(res); |
|
43 } |
|
44 } |
|
45 |
|
46 TInt CUsbCustomDescriptorParserList::NumOfRegisteredParsers() const |
|
47 { |
|
48 return iParserList.Count(); |
|
49 } |
|
50 |
|
51 UsbDescriptorParser::TUsbDescriptorParserL CUsbCustomDescriptorParserList::RegisteredParser(TInt aIndex) const |
|
52 { |
|
53 return iParserList[aIndex]; |
|
54 } |
|
55 |