Update contrib.
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
26 #ifndef __CAF_METADATAARRAY_H__
27 #define __CAF_METADATAARRAY_H__
35 namespace ContentAccess
40 Stores an array of CMetaData objects for use in a supplier import operation
42 It provides search and routines (for both 8 bit and Unicode) to find the
43 value corresponding to a particular field in the array.
45 Applications should use the unicode search function whenever possible because
46 it removes the risk of losing information during the unicode to 8 bit
50 class CMetaDataArray : public CBase
54 IMPORT_C static CMetaDataArray* NewL();
55 IMPORT_C static CMetaDataArray* NewLC();
57 /** Construct a CMetaDataArray from a stream
58 @param aStream the stream containing the metadata array
59 @return a new CMetaDataArray
61 IMPORT_C static CMetaDataArray* NewL(RReadStream& aStream);
64 virtual ~CMetaDataArray();
66 /** Adds a new meta data,
67 @param aField The name used to index the value of interest
70 IMPORT_C void AddL(const TDesC8& aField, const TDesC8& aData);
72 /** Adds a new meta data,
73 @param aField The name used to index the value of interest
76 IMPORT_C void AddL(const TDesC& aField, const TDesC& aData);
78 /** Retrieves the MetaData at the given index
80 * @param aIndex The index of the meta-data
83 IMPORT_C const CMetaData& operator [] (TInt aIndex) const;
85 /** The number of metadata objects in the list
87 IMPORT_C TInt Count() const;
89 /** Find the unicode data for a given unicode field.
91 @param aField The field to retrieve
92 @param aMatchCase ETrue To perform case sensitive search, EFalse - To perform non case sensitive search
93 @return The corresponding data or else a zero length string if the field was not found
95 IMPORT_C const TDesC& SearchL(const TDesC& aField, TBool aMatchCase = EFalse) const;
97 /** Find the 8 bit data for a given 8 bit field.
99 @param aField8 The field to retrieve
100 @param aMatchCase ETrue To perform case sensitive search, EFalse - To perform non case sensitive search
101 @return The corresponding data or else a zero length string if the field was not found
103 IMPORT_C const TDesC8& SearchL(const TDesC8& aField8, TBool aMatchCase = EFalse) const;
105 /** Externalizes the CMetaDataArray object to a stream.
107 * @param aStream The stream to write the header information to.
109 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
113 void InternalizeL(RReadStream& aStream);
116 RPointerArray <CMetaData> iArray;
118 // Length of the longest data item in the array
119 TInt iMaxFieldLength;