|
1 /* |
|
2 * Copyright (c) 2005-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 * Filename: UCCS_CCommandDecoder.h |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __UCCSCOMMANDLINE_H__ |
|
22 #define __UCCSCOMMANDLINE_H__ |
|
23 |
|
24 |
|
25 /*********************************************************************************** |
|
26 * |
|
27 * System Includes |
|
28 * |
|
29 **********************************************************************************/ |
|
30 #include <stdio.h> |
|
31 #include <stdlib.h> |
|
32 |
|
33 |
|
34 /*********************************************************************************** |
|
35 * |
|
36 * Local Includes |
|
37 * |
|
38 **********************************************************************************/ |
|
39 #include "UCCS_CServMgr.h" |
|
40 #include "UCCS_ErrorCodes.h" |
|
41 #include "UCCS_CDataRecord.h" |
|
42 |
|
43 /*********************************************************************************** |
|
44 * |
|
45 * Definitions |
|
46 * |
|
47 **********************************************************************************/ |
|
48 #define MAXFIELDCOUNT 1024 |
|
49 |
|
50 /*********************************************************************************** |
|
51 * |
|
52 * Types |
|
53 * |
|
54 **********************************************************************************/ |
|
55 typedef struct { |
|
56 char *iName; |
|
57 char *iValue; |
|
58 int iLength; |
|
59 } TFieldDesc; |
|
60 |
|
61 /*********************************************************************************** |
|
62 * |
|
63 * CCommandDecoder definition |
|
64 * |
|
65 **********************************************************************************/ |
|
66 class CCommandDecoder |
|
67 { |
|
68 public: |
|
69 |
|
70 //methods |
|
71 CCommandDecoder( CDataRecord *aEnvironment ); |
|
72 ~CCommandDecoder(); |
|
73 int ParseCommandToRecord( char *aCommandstring, CDataRecord *aRecord ); |
|
74 void SetLastReply( CDataRecord *aLastReply ); |
|
75 |
|
76 private: |
|
77 int ParseCommand( char* aCommandstring, TFieldDesc *aFieldList, int aListLength ); |
|
78 int StoreNextValue( char *aName, char *aValue, int aFileFlag, TFieldDesc *aFieldList, int aIndex ); |
|
79 char *FindEndOfDoubleQuotes( char *aString ); |
|
80 int GetFileSize( char *aFilename ); |
|
81 int ReadFileIntoBuffer( char *aFilename, char *aBuff, int aBuffSize ); |
|
82 void Cleanup( TFieldDesc *aFieldList, int aLen ); |
|
83 int DecodeEscapeSequences(char *start_value); |
|
84 |
|
85 CDataRecord *iLastReply; |
|
86 CDataRecord *iEnvironment; |
|
87 }; |
|
88 //---------------------------------------------------------------------------------- |
|
89 |
|
90 #endif __UCCSCOMMANDLINE_H__ |