|
1 /* |
|
2 * Copyright (c) 2004 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: This class implements an 3gp metadata parser as specified in |
|
15 * www.3gpp.org (specification 3GPP TS 26.244 V6.0.0). |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CMetaDataParserDcf_H |
|
22 #define CMetaDataParserDcf_H |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 #include <e32base.h> |
|
27 |
|
28 #include "MetaDataSourceFile.h" |
|
29 #include "MetaDataParser.h" |
|
30 #include "MetaDataFieldContainer.h" |
|
31 #include "MetaDataField.h" |
|
32 |
|
33 // CONSTANTS |
|
34 |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * This class implements an 3gp metadata parser. |
|
40 * |
|
41 * @lib MetaDataUtility.lib |
|
42 * @since 3.0 |
|
43 */ |
|
44 class CMetaDataParserDcf : public CMetaDataParser |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 * @return A pointer to a new instance of parser; NULL if parser is not created. |
|
51 */ |
|
52 static CMetaDataParserDcf* NewL(); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 virtual ~CMetaDataParserDcf(); |
|
58 |
|
59 public: // Functions from base classes |
|
60 |
|
61 /** |
|
62 * From CMetaDataParser |
|
63 * Parses the source and if metadata is found, the metadata fields are |
|
64 * inserted into the container. |
|
65 * @since 3.0 |
|
66 * @param aWantedFields An array of TMetaDataFieldId's. Empty array is interpreted as all fields. |
|
67 * @param aContainer On return, metadata found in aSource is stored here |
|
68 * @return void |
|
69 */ |
|
70 void ParseL( const RArray<TMetaDataFieldId>& aWantedFields, CMetaDataFieldContainer& aContainer ); |
|
71 |
|
72 public: // New functions |
|
73 |
|
74 /** |
|
75 * Initializes the parser with the specified file. |
|
76 * @since 3.0 |
|
77 * @param aFileName The name of the file |
|
78 * @return void |
|
79 */ |
|
80 void InitializeFileL( CMetaDataSource* aSource ); |
|
81 |
|
82 private: |
|
83 |
|
84 /** |
|
85 * C++ default constructor. |
|
86 */ |
|
87 CMetaDataParserDcf(); |
|
88 |
|
89 /** |
|
90 * By default Symbian 2nd phase constructor is private. |
|
91 */ |
|
92 void ConstructL(); |
|
93 |
|
94 /** |
|
95 * Validates whether this is valid DCF source or not. |
|
96 * @return ETrue if valid, EFalse otherwise. |
|
97 */ |
|
98 TBool ValidateL(); |
|
99 |
|
100 /** |
|
101 * Converts to unicode. |
|
102 * @param aDesc Source to be converted to unicode. |
|
103 * @param aUnicode Contains the converted unicode on return. |
|
104 * @return The number of unconverted characters left at the end of the input descriptor |
|
105 * (e.g. because the output descriptor is not long enough to hold all the text), |
|
106 * or one of the error values defined in TError. |
|
107 */ |
|
108 TInt ConvertToUnicodeL( const TDesC8& aDesc, TDes16& aUnicode ); |
|
109 |
|
110 private: |
|
111 |
|
112 /** |
|
113 * Reads meta data from DCF header. Leaves on error. |
|
114 * @param aEntryName name of header field to read. |
|
115 * @param aFieldId field id defined in MetaDataField.hrh. |
|
116 * @return void |
|
117 */ |
|
118 void ReadMetaDataEntryL(TInt aEntryName, TMetaDataFieldId aFieldId); |
|
119 |
|
120 private: // Data |
|
121 |
|
122 // source |
|
123 CMetaDataSource* iSource; |
|
124 |
|
125 }; |
|
126 |
|
127 #endif // CMetaDataParserDcf_H |
|
128 |
|
129 // End of File |