|
1 /* |
|
2 * Copyright (c) 2002 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 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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * parsing command lines could be used in view activation |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef BROWSER_COMMAND_LINE_PARSER_H |
|
23 #define BROWSER_COMMAND_LINE_PARSER_H |
|
24 |
|
25 // INCLUDES |
|
26 #include <E32Base.h> |
|
27 |
|
28 // CLASS DECLARATION |
|
29 |
|
30 /** |
|
31 * CBrowserCommandLineParser8 class |
|
32 * Purpose: parsing command lines could be used in view activation. |
|
33 * @lib Browser.app |
|
34 * @since Series 60 1.2 |
|
35 */ |
|
36 class CBrowserCommandLineParser8 : public CBase |
|
37 { |
|
38 public: //Constructors and destructor |
|
39 |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 * @param aParamString String of parameters |
|
43 */ |
|
44 static CBrowserCommandLineParser8* NewL( const TDesC8& aParamString ); |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. Cleanup stack used. |
|
48 * @param aParamString String of parameters |
|
49 */ |
|
50 static CBrowserCommandLineParser8* NewLC( const TDesC8& aParamString ); |
|
51 |
|
52 /** |
|
53 * C++ Default constructor. |
|
54 */ |
|
55 CBrowserCommandLineParser8(); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 ~CBrowserCommandLineParser8(); |
|
61 |
|
62 public: // New functions |
|
63 |
|
64 /** |
|
65 * Count the parameters. |
|
66 * @since Series 60 1.2 |
|
67 * @return Count of parameters |
|
68 */ |
|
69 TUint Count() const; |
|
70 |
|
71 /** |
|
72 * Set parameters to member variable. |
|
73 * @since Series 60 1.2 |
|
74 * @param aParamString String of parameters |
|
75 */ |
|
76 void SetL( const TDesC8& aParamString ); |
|
77 |
|
78 /** |
|
79 * Get pointer to a certain parameter in parameter array. |
|
80 * @since Series 60 1.2 |
|
81 * @param aIndex Index from where to get the parameter |
|
82 */ |
|
83 TPtrC8 Param( TUint aIndex ); |
|
84 |
|
85 /** |
|
86 * Check whether the parameter is integer or not. |
|
87 * @since Series 60 1.2 |
|
88 * @param aIndex Index from where to get the parameter |
|
89 * @return ETrue if the parameter is integer |
|
90 */ |
|
91 TBool IntegerParam( TUint aIndex ); |
|
92 |
|
93 /** |
|
94 * Extract a signed integer from parameter array. |
|
95 * @since Series 60 1.2 |
|
96 * @param aIndex Index from where the parameter is extracted |
|
97 * @return Parameter as signed integer |
|
98 */ |
|
99 TInt ParamToInteger( TUint aIndex ); |
|
100 |
|
101 |
|
102 private: |
|
103 |
|
104 /** |
|
105 * Symbian 2nd phase constructor. |
|
106 */ |
|
107 void ConstructL( const TDesC8& aParamString ); |
|
108 |
|
109 /** |
|
110 * Fill array with parameters. |
|
111 * Strips any white spaces. |
|
112 * @since Series 60 1.2 |
|
113 */ |
|
114 void FillUpParamsL(); |
|
115 |
|
116 private: // Data |
|
117 |
|
118 HBufC8* iParamString ; //copy created in ConstructL |
|
119 |
|
120 CArrayFixFlat<TPtrC8>* iParams; //array of parameters |
|
121 }; |
|
122 |
|
123 #endif // BROWSER_COMMAND_LINE_PARSER_H// End of File |