|
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 3GPExt metadata parser |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CMETADATAPARSER3GPEXT_H |
|
21 #define CMETADATAPARSER3GPEXT_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include "MetaDataParserMP4.h" |
|
26 #include "MetaDataFieldContainer.h" |
|
27 #include "MetaDataField.h" |
|
28 |
|
29 // CONSTANTS |
|
30 |
|
31 // CLASS DECLARATION |
|
32 class C3GPExtParser; |
|
33 |
|
34 /** |
|
35 * This class implements an 3GPExt metadata parser. |
|
36 * |
|
37 * @lib MetaDataUtility.lib |
|
38 * @since 3.0 |
|
39 */ |
|
40 class CMetaDataParser3GPExt : public CMetaDataParserMP4 |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 * @return A pointer to a new instance of parser; NULL if parser is not created. |
|
47 */ |
|
48 static CMetaDataParser3GPExt* NewL(); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 virtual ~CMetaDataParser3GPExt(); |
|
54 |
|
55 public: // Functions from base classes |
|
56 |
|
57 /** |
|
58 * From CMetaDataParserMP4 |
|
59 * Parses the source and if metadata is found, the metadata fields are |
|
60 * inserted into the container. |
|
61 * @since 3.0 |
|
62 * @param aWantedFields An array of TMetaDataFieldId's. Empty array is interpreted as all fields. |
|
63 * @param aContainer On return, metadata found in aSource is stored here |
|
64 * @return void |
|
65 */ |
|
66 void ParseL( const RArray<TMetaDataFieldId>& aWantedFields, CMetaDataFieldContainer& aContainer ); |
|
67 |
|
68 /** |
|
69 * From CMetaDataParserMP4 |
|
70 * Validates whether this is valid 3GPExt source or not. |
|
71 * @since 3.0 |
|
72 * @return ETrue if valid, EFalse otherwise. |
|
73 */ |
|
74 TBool ValidateL(); |
|
75 |
|
76 |
|
77 private: |
|
78 |
|
79 void ConvertAndAppendL(HBufC8** buf8, TMetaDataFieldId aFieldId); |
|
80 /** |
|
81 * Converts to unicode. |
|
82 * @param aDesc Source to be converted to unicode. |
|
83 * @param aUnicode Contains the converted unicode on return. |
|
84 * @return KErrNone if successful, otherwise one of the system errors. |
|
85 */ |
|
86 TInt ConvertToUnicodeL( const TDesC8& aDesc, TDes16& aUnicode ); |
|
87 |
|
88 /** |
|
89 * C++ default constructor. |
|
90 */ |
|
91 CMetaDataParser3GPExt(); |
|
92 |
|
93 /** |
|
94 * By default Symbian 2nd phase constructor is private. |
|
95 */ |
|
96 void ConstructL(); |
|
97 |
|
98 /** |
|
99 * Utility function to Append |
|
100 */ |
|
101 void AppendL(HBufC** aBuf, TMetaDataFieldId aFieldId); |
|
102 /** |
|
103 * Utility function to Append |
|
104 */ |
|
105 void AppendL(HBufC8** aBuf, TMetaDataFieldId aFieldId); |
|
106 |
|
107 private: |
|
108 |
|
109 // C3GPExtParser |
|
110 C3GPExtParser *i3GPExtParser; |
|
111 }; |
|
112 |
|
113 #endif // CMETADATAPARSER3GPEXT_H |
|
114 |
|
115 // End of File |