mmserv/metadatautility/Src/MetaDataSource.h
changeset 0 71ca22bcf22a
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     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 provides base class for metadata source classes used
       
    15 *                by different parsers.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CMETADATASOURCE_H
       
    22 #define CMETADATASOURCE_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 
       
    27 // CLASS DECLARATION
       
    28 
       
    29 /**
       
    30 *  This class implements base class for metadata sources such as files or descriptors.
       
    31 *
       
    32 *  @lib MetaDataUtility.lib
       
    33 *  @since 3.0
       
    34 */
       
    35 class CMetaDataSource : public CBase
       
    36 	{
       
    37 	public:  // Destructor
       
    38 
       
    39 		/**
       
    40 		* Destructor.
       
    41 		*/
       
    42 		virtual ~CMetaDataSource();
       
    43 
       
    44 	protected:  // Constructor
       
    45 
       
    46         /**
       
    47         * C++ default constructor.
       
    48         */
       
    49 		CMetaDataSource();
       
    50 
       
    51     public: // New functions
       
    52 
       
    53         /**
       
    54         * Reads sufficient data from the source to fill the specified 8-bit descriptor
       
    55         * up to its maximum length.
       
    56         * @since 3.0
       
    57         * @param aDes Contains the data that was read
       
    58 		* @param aLength How many bytes will be read
       
    59         * @return KErrNone, or one of the systemwide error codes.
       
    60 		*/
       
    61 		virtual void ReadL( TDes8& aDes ) = 0;
       
    62 
       
    63         /**
       
    64         * Reads data of specified length from the source into the specified 8-bit descriptor.
       
    65         * @since 3.0
       
    66         * @param aDes Contains the data that was read. Note that the descriptor
       
    67 		*        length must be at least aLength!
       
    68 		* @param aLength How many bytes will be read
       
    69         * @return KErrNone, or one of the systemwide error codes.
       
    70 		*/
       
    71 		virtual void ReadL( TDes8& aDes, TInt aLength ) = 0;
       
    72 
       
    73         /**
       
    74         * Reads data from specified position in the source into the specified 8-bit descriptor
       
    75         * up to its maximum length.
       
    76         * @since 3.0
       
    77         * @param aPos Offset from current position
       
    78 		* @param aDes Contains the data that was read
       
    79         * @return KErrNone, or one of the systemwide error codes.
       
    80 		*/
       
    81 		virtual void ReadL( TInt aPos, TDes8& aDes ) = 0;
       
    82 
       
    83         /**
       
    84         * Reads data from specified position in the source into the specified 8-bit descriptor
       
    85         * up to its maximum length.
       
    86         * @since 3.0
       
    87         * @param aPos Offset from current position
       
    88 		* @param aDes Contains the data that was read
       
    89 		* @param aLength How many bytes will be read
       
    90         * @return KErrNone, or one of the systemwide error codes.
       
    91 		*/
       
    92 		virtual void ReadL( TInt aPos, TDes8& aDes, TInt aLength ) = 0;
       
    93 
       
    94         /**
       
    95         * Returns the size of the source in bytes.
       
    96         * @since 3.0
       
    97         * @param aSize On return, the size is stored here.
       
    98         * @return KErrNone, or one of the systemwide error codes.
       
    99 		*/
       
   100 		virtual TInt Size( TInt& aSize ) const = 0;
       
   101 
       
   102 	};
       
   103 
       
   104 #endif      // CMETADATASOURCE_H
       
   105 
       
   106 // End of File