mmserv/metadatautility/Src/MetaDataParser.h
branchRCL_3
changeset 17 3570217d8c21
parent 0 71ca22bcf22a
child 18 2eb3b066cc7d
equal deleted inserted replaced
13:f5c5c82a163e 17:3570217d8c21
    24 // INCLUDES
    24 // INCLUDES
    25 #include <e32base.h>
    25 #include <e32base.h>
    26 #include <MetaDataField.hrh>
    26 #include <MetaDataField.hrh>
    27 #include <f32file.h>
    27 #include <f32file.h>
    28 #include <charconv.h>
    28 #include <charconv.h>
    29 #include "MetaDataID3v1Genre.h"
       
    30 #include <barsc.h>
    29 #include <barsc.h>
    31 #include <barsread.h>
    30 #include <barsread.h>
    32 
    31 
       
    32 #include "MetaDataID3v1Genre.h"
    33 
    33 
    34 // FORWARD DECLARATION
    34 // FORWARD DECLARATION
    35 class CMetaDataFieldContainer;
    35 class CMetaDataFieldContainer;
       
    36 class CMetaDataSourceFile;
    36 
    37 
    37 // CONSTANTS
    38 // CONSTANTS
    38 const TInt KUnicodeBOMNotFound		= 0;
    39 const TInt KUnicodeBOMNotFound		= 0;
    39 const TInt KUnicodeBOMBigEndian		= 1;
    40 const TInt KUnicodeBOMBigEndian		= 1;
    40 const TInt KUnicodeBOMLittleEndian	= 2;
    41 const TInt KUnicodeBOMLittleEndian	= 2;
    95         * @param aNum genre integer code
    96         * @param aNum genre integer code
    96         * @param aGenrePtr string genre value returned
    97         * @param aGenrePtr string genre value returned
    97         * @since 3.0
    98         * @since 3.0
    98         * @return void
    99         * @return void
    99         */
   100         */
   100 		void MapID3GenreToStringL(TInt aNum, TDes& aGenrePtr);
   101 		void MapID3GenreToStringL( TInt aNum, TDes& aGenrePtr );
   101 
   102 
   102 		/**
   103 		/**
   103         * Maps ID3v2 genre integer to string
   104         * Maps ID3v2 genre integer to string
   104         * @param aNum genre integer code
   105         * @param aNum genre integer code
   105         * @param aGenrePtr string genre value returned
   106         * @param aGenrePtr string genre value returned
   106         * @since 3.0
   107         * @since 3.0
   107         * @return void
   108         * @return void
   108         */
   109         */
   109 
   110 
   110 		void MapID3GenreToStringL(TInt aNum, TDes8& aGenrePtr);
   111 		void MapID3GenreToStringL( TInt aNum, TDes8& aGenrePtr );
   111 		void GenerateTopCharacterSetsL();
   112 		void GenerateTopCharacterSetsL();
   112 		void SelectCharacterSetsForLanguageL(TInt aLanguage);
   113 		void SelectCharacterSetsForLanguageL( TInt aLanguage );
   113 		void ReadCharacterSetResourceL(TInt aResourceId);
   114 		void ReadCharacterSetResourceL( TInt aResourceId );
   114 		TBool IsInTopCharacterSet(TUint aCharacterSetId);
   115 		TBool IsInTopCharacterSet( TUint aCharacterSetId );
       
   116 
       
   117 		/**
       
   118         * Parses the common metadata, the metadata fields are
       
   119         * inserted into the container.
       
   120         * @since 9.2
       
   121         * @param aSource a Metadata source file.
       
   122         * @param aWantedFields An array of TMetaDataFieldId's. Empty array is interpreted as all fields.
       
   123         * @param aContainer On return, metadata found in aSource is stored here
       
   124         * @return void
       
   125         */
       
   126         void CommonParseL( CMetaDataSourceFile* aSource,
       
   127                 const RArray<TMetaDataFieldId>& aWantedFields, 
       
   128                 CMetaDataFieldContainer& aContainer );
       
   129 
       
   130         /**
       
   131         * Append DRM Protected data to the container.
       
   132         * @param aSource a Metadata source file.
       
   133         * @param aContainer On return, metadata ptotected data is stored here
       
   134         * @return void
       
   135         */
       
   136 		void GetProtectedL( CMetaDataSourceFile* aSource,
       
   137 		        CMetaDataFieldContainer& aContainer );
   115 
   138 
   116     protected:
   139     protected:
   117 
   140 
   118         /**
   141         /**
   119         * Strips trailing zeros at the end of the field.
   142         * Strips trailing zeros at the end of the field.
   120         * @since 3.0
   143         * @since 3.0
   121         * @param aDesc The original descriptor
   144         * @param aDesc The original descriptor
   122         * @return Pointer to descriptor without whitespace
   145         * @return Pointer to descriptor without whitespace
   123         */
   146         */
   124         TPtrC8 StripTrailingZeroes( const TDesC8& aDesc, TInt encoding = 0);
   147         TPtrC8 StripTrailingZeroes( const TDesC8& aDesc, TInt encoding = 0 );
   125         TPtrC StripTrailingZeroes( const TDesC& aDesc);
   148         TPtrC StripTrailingZeroes( const TDesC& aDesc );
   126 
   149 
   127         /**
   150         /**
   128         * Returns BOM indication in the provided unicode.
   151         * Returns BOM indication in the provided unicode.
   129         * @since 3.0
   152         * @since 3.0
   130         * @param aUnicode Descriptor containing unicode.
   153         * @param aUnicode Descriptor containing unicode.