|
1 /** @file |
|
2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: CUpnpMSearchTimer |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 |
|
21 #include "upnpnotifytimer.h" |
|
22 #include "upnpmsearchtimer.h" |
|
23 #define KLogFile _L("DLNAWebServer.txt") |
|
24 #include "upnpcustomlog.h" |
|
25 |
|
26 // ============================ MEMBER FUNCTIONS =============================== |
|
27 |
|
28 // ----------------------------------------------------------------------------- |
|
29 // CUpnpMSearchTimer::CUpnpMSearchTimer |
|
30 // C++ default constructor |
|
31 // ----------------------------------------------------------------------------- |
|
32 // |
|
33 EXPORT_C CUpnpMSearchTimer::CUpnpMSearchTimer(MUpnpNotifyTimerObserver* aObserver) |
|
34 : CUpnpNotifyTimer(aObserver) |
|
35 { |
|
36 } |
|
37 // ---------------------------------------------------------------------------- |
|
38 // CUpnpMSearchTimer::NewL |
|
39 // ----------------------------------------------------------------------------- |
|
40 // |
|
41 EXPORT_C CUpnpMSearchTimer* CUpnpMSearchTimer::NewL(MUpnpNotifyTimerObserver* aObserver, |
|
42 const TDesC8& aTarget, |
|
43 const TDesC8& aMX) |
|
44 { |
|
45 CUpnpMSearchTimer* self = CUpnpMSearchTimer::NewLC(aObserver,aTarget,aMX); |
|
46 CleanupStack::Pop( self ); |
|
47 return self; |
|
48 } |
|
49 |
|
50 // ---------------------------------------------------------------------------- |
|
51 // CUpnpMSearchTimer::NewL |
|
52 // ----------------------------------------------------------------------------- |
|
53 // |
|
54 EXPORT_C CUpnpMSearchTimer* CUpnpMSearchTimer::NewLC(MUpnpNotifyTimerObserver* aObserver, |
|
55 const TDesC8& aTarget, |
|
56 const TDesC8& aMX) |
|
57 { |
|
58 CUpnpMSearchTimer* self = new (ELeave) CUpnpMSearchTimer(aObserver); |
|
59 CleanupStack::PushL( self ); |
|
60 self->ConstructL(aTarget, aMX); |
|
61 return self; |
|
62 } |
|
63 |
|
64 // ---------------------------------------------------------------------------- |
|
65 // CUpnpMSearchTimer::ConstructL |
|
66 // Two-phased constructor. |
|
67 // ----------------------------------------------------------------------------- |
|
68 // |
|
69 void CUpnpMSearchTimer::ConstructL(const TDesC8& aTarget, |
|
70 const TDesC8& aMX) |
|
71 { |
|
72 CUpnpNotifyTimer::ConstructL(); |
|
73 iTarget = aTarget.AllocL(); |
|
74 iMXString = aMX.AllocL(); |
|
75 TLex8 tmp(*iMXString); |
|
76 iMX = tmp; |
|
77 } |
|
78 // ----------------------------------------------------------------------------- |
|
79 // CUpnpMSearchTimer::~CUpnpMSearchTimer |
|
80 // C++ default destructor |
|
81 // ----------------------------------------------------------------------------- |
|
82 // |
|
83 CUpnpMSearchTimer::~CUpnpMSearchTimer() |
|
84 { |
|
85 delete iTarget; |
|
86 delete iMXString; |
|
87 } |
|
88 |
|
89 EXPORT_C TInt CUpnpMSearchTimer::GetNextValue() |
|
90 { |
|
91 TInt i; |
|
92 TInt res = iMX.Val(i); |
|
93 if(res) |
|
94 { |
|
95 return res; |
|
96 } |
|
97 for(;;) |
|
98 { |
|
99 if (!iMX.Get().IsDigit() || iMX.Get() == ',') |
|
100 { |
|
101 break; |
|
102 } |
|
103 } |
|
104 return i; |
|
105 } |
|
106 |
|
107 EXPORT_C TPtrC8 CUpnpMSearchTimer::GetTarget() |
|
108 { |
|
109 return *iTarget; |
|
110 } |
|
111 |
|
112 // End Of File |