|
1 /* |
|
2 * Copyright (c) 2008-2009 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 * Class for processing parameter-file. |
|
16 * @internalComponent |
|
17 * @released |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 #ifndef PARAMETERFILEPROCESSOR_H |
|
23 #define PARAMETERFILEPROCESSOR_H |
|
24 |
|
25 #include<iostream> |
|
26 #include<string> |
|
27 #include<vector> |
|
28 #include<fstream> |
|
29 |
|
30 typedef std::string String; |
|
31 typedef std::vector<String> VectorOfStrings; |
|
32 typedef std::ifstream FileInputStream; |
|
33 |
|
34 /** |
|
35 Class CParameterFileProcessor for processing parameter-file |
|
36 |
|
37 @internalComponent |
|
38 @released |
|
39 */ |
|
40 |
|
41 class CParameterFileProcessor |
|
42 { |
|
43 FileInputStream iParamFile; |
|
44 String iParamFileName; // Parameter-file name |
|
45 VectorOfStrings iParameters; // Parameters read from parameter-file |
|
46 unsigned int iNoOfArguments; // Number of parameters present in the parameter-file. |
|
47 char **iParamFileArgs; // Pointer to 2D character array containing the parameters |
|
48 // read from parameter-file. |
|
49 |
|
50 public: |
|
51 CParameterFileProcessor(String aParamFileName); |
|
52 bool ParameterFileProcessor(); |
|
53 unsigned int GetNoOfArguments() const; |
|
54 char** GetParameters() const; |
|
55 ~CParameterFileProcessor(); |
|
56 |
|
57 private: |
|
58 bool OpenFile(); |
|
59 bool SplitLine(String& aLine); |
|
60 bool SetNoOfArguments(); |
|
61 void SetParameters(); |
|
62 void CloseFile(); |
|
63 }; |
|
64 |
|
65 #endif //PARAMETERFILEPROCESSOR_H |