|
1 /* |
|
2 * Copyright (c) 2006-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 "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 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __COMMAND_FILE_H__ |
|
20 #define __COMMAND_FILE_H__ |
|
21 #include "CmdGlobals.h" |
|
22 #ifdef __WIN__ |
|
23 #pragma warning(disable:4786) |
|
24 #endif |
|
25 #include <string> |
|
26 |
|
27 using namespace std; |
|
28 |
|
29 /** |
|
30 * The CommandFile class is a utility class for the CommandLine class, |
|
31 * so that the CommandLine class can represent the given parameters |
|
32 * in a unified way given in a command line or a command file. This |
|
33 * class utilizes command file parsing if needed. |
|
34 */ |
|
35 class CommandFile |
|
36 { |
|
37 public: |
|
38 /** |
|
39 * Constructor |
|
40 * @param filename command filename |
|
41 */ |
|
42 CommandFile(string filename); |
|
43 |
|
44 /** |
|
45 * Destructor |
|
46 */ |
|
47 ~CommandFile(); |
|
48 |
|
49 public: |
|
50 |
|
51 /** |
|
52 * Get Header analyser commandline parameters |
|
53 * @return pointer to commandline params |
|
54 */ |
|
55 char** getCommandBuffer(); |
|
56 |
|
57 /** |
|
58 * Get command buffer length |
|
59 * @return command buffer length |
|
60 */ |
|
61 size_t commandBufferLength(); |
|
62 |
|
63 /** |
|
64 * Replace tab charecters in file |
|
65 * @param filename file to which characters are replaced |
|
66 */ |
|
67 //void replaceTabs(string filename); |
|
68 |
|
69 private: |
|
70 /** |
|
71 * Reads parameters from the command file. Basically works just as |
|
72 * CommandLine's equivalent function |
|
73 * @param filename command filename |
|
74 * @exception an exception is thrown in case the file can't be opened. |
|
75 */ |
|
76 void readCommandFile(string filename); |
|
77 |
|
78 private: |
|
79 //! command buffer length |
|
80 size_t iCmdBufLen; |
|
81 |
|
82 //! Command filename (eg. Commandfile.txt) |
|
83 string iFilename; |
|
84 |
|
85 //! Pointer to commandline parameters |
|
86 char** iCmdBuf; |
|
87 }; |
|
88 |
|
89 #endif |