|
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 the interface specified in CMetaDataSource |
|
15 * when audio source is from a descriptor. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CMETADATASOURCEDESCRIPTOR_H |
|
22 #define CMETADATASOURCEDESCRIPTOR_H |
|
23 |
|
24 // INCLUDES |
|
25 #include "MetaDataSource.h" |
|
26 |
|
27 // CLASS DECLARATION |
|
28 |
|
29 /** |
|
30 * This class implements the interface specified in CMetaDataSource |
|
31 * when audio source is from a descriptor. |
|
32 * |
|
33 * @lib MetaDataUtility.lib |
|
34 * @since 3.0 |
|
35 */ |
|
36 class CMetaDataSourceDescriptor : public CMetaDataSource |
|
37 { |
|
38 public: // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 * @param aDes Source descriptor |
|
43 * @return A pointer to a new instance of this class |
|
44 */ |
|
45 static CMetaDataSourceDescriptor* NewL( const TDesC8& aDes ); |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 virtual ~CMetaDataSourceDescriptor(); |
|
51 |
|
52 public: // Functions from base classes |
|
53 |
|
54 /** |
|
55 * Reads sufficient data from the source to fill the specified 8-bit descriptor |
|
56 * up to its maximum length. |
|
57 * @since 3.0 |
|
58 * @param aDes Contains the data that was read |
|
59 * @param aLength How many bytes will be read |
|
60 * @return KErrNone, or one of the systemwide error codes. |
|
61 */ |
|
62 void ReadL( TDes8& aDes ); |
|
63 |
|
64 /** |
|
65 * Reads data of specified length from the source into the specified 8-bit descriptor. |
|
66 * @since 3.0 |
|
67 * @param aDes Contains the data that was read. Note that the descriptor |
|
68 * length must be at least aLength! |
|
69 * @param aLength How many bytes will be read |
|
70 * @return KErrNone, or one of the systemwide error codes. |
|
71 */ |
|
72 void ReadL( TDes8& aDes, TInt aLength ); |
|
73 |
|
74 /** |
|
75 * Reads data from specified position in the source into the specified 8-bit descriptor |
|
76 * up to its maximum length. |
|
77 * @since 3.0 |
|
78 * @param aPos Offset from current position |
|
79 * @param aDes Contains the data that was read |
|
80 * @return KErrNone, or one of the systemwide error codes. |
|
81 */ |
|
82 void ReadL( TInt aPos, TDes8& aDes ); |
|
83 |
|
84 /** |
|
85 * Reads data from specified position in the source into the specified 8-bit descriptor |
|
86 * up to its maximum length. |
|
87 * @since 3.0 |
|
88 * @param aPos Offset from current position |
|
89 * @param aDes Contains the data that was read |
|
90 * @param aLength How many bytes will be read |
|
91 * @return KErrNone, or one of the systemwide error codes. |
|
92 */ |
|
93 void ReadL( TInt aPos, TDes8& aDes, TInt aLength ); |
|
94 |
|
95 /** |
|
96 * Size of the source in bytes. |
|
97 * @since 3.0 |
|
98 * @param aSize On return, the size is stored here. |
|
99 * @return KErrNone, or one of the systemwide error codes. |
|
100 */ |
|
101 TInt Size( TInt& aSize ) const; |
|
102 |
|
103 private: |
|
104 |
|
105 /** |
|
106 * C++ default constructor. |
|
107 */ |
|
108 CMetaDataSourceDescriptor(); |
|
109 |
|
110 /** |
|
111 * By default Symbian 2nd phase constructor is private. |
|
112 */ |
|
113 void ConstructL( const TDesC8& aDes ); |
|
114 |
|
115 private: // Data |
|
116 |
|
117 // Source descriptor |
|
118 TPtrC8 iSource; |
|
119 // Source length |
|
120 TInt iLength; |
|
121 }; |
|
122 |
|
123 #endif // CMETADATASOURCEDESCRIPTOR_H |
|
124 |
|
125 // End of File |