installationservices/swi/inc/swi/sisuid.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2004-2009 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 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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * Definition of the Swi::Sis::CUid
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file 
       
    22  @released
       
    23  @internalTechnology
       
    24 */
       
    25 
       
    26 #ifndef __SISUID_H__
       
    27 #define __SISUID_H__
       
    28 
       
    29 #include <e32base.h>
       
    30 #include "sisfield.h"
       
    31 
       
    32 namespace Swi
       
    33 {
       
    34 namespace Sis
       
    35  {
       
    36  
       
    37  class TPtrProvider;
       
    38 
       
    39 /**
       
    40  * This class represents a SisUid. SisUid is a basic structure found in  files.
       
    41  * It is described in SGL.GT0188.251.
       
    42  *
       
    43  * @released
       
    44  * @internalTechnology
       
    45  */
       
    46 class CUid : public CField
       
    47 	{
       
    48 public:
       
    49 
       
    50 	/**
       
    51 	 * This creates a new CUid object.
       
    52 	 *
       
    53 	 * @param aDataProvider		 An instance of a MSisDataProvider to read the entity from.
       
    54 	 * @param aTypeReadBehaviour Whether we need to check the sis type or not.
       
    55 	 *
       
    56 	 * @return An instance of CUid representing the data read.	 
       
    57 	 */
       
    58 	IMPORT_C static CUid* NewL(MSisDataProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour = EReadType);
       
    59 
       
    60 	/**
       
    61 	 * This creates a new CUid object and places it on the cleanup stack.
       
    62 	 *
       
    63 	 * @param aDataProvider		 An instance of a MSisDataProvider to read the entity from.
       
    64 	 * @param aTypeReadBehaviour Whether we need to check the sis type or not.
       
    65 	 *
       
    66 	 * @return An instance of CUid representing the data read.	 
       
    67 	 */
       
    68 	IMPORT_C static CUid* NewLC(MSisDataProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour = EReadType);
       
    69 
       
    70 	/**
       
    71 	 * This creates a new CUid object in place.
       
    72 	 *
       
    73 	 * @param aDataProvider		 An instance of a TPtrProvider to read the entity from.
       
    74 	 * @param aTypeReadBehaviour Whether we need to check the sis type or not.
       
    75 	 *
       
    76 	 * @return An instance of CUid representing the data read.	 
       
    77 	 */
       
    78 
       
    79 	IMPORT_C static CUid* NewL(TPtrProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour = EReadType);
       
    80 
       
    81 	/**
       
    82 	 * This creates a new CUid object in place and places it on the cleanup stack.
       
    83 	 *
       
    84 	 * @param aDataProvider		 An instance of a TPtrProvider to read the entity from.
       
    85 	 * @param aTypeReadBehaviour Whether we need to check the sis type or not.
       
    86 	 *
       
    87 	 * @return An instance of CUid representing the data read.	 
       
    88 	 */
       
    89 
       
    90 	IMPORT_C static CUid* NewLC(TPtrProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour = EReadType);
       
    91 
       
    92 	IMPORT_C virtual ~CUid();
       
    93 
       
    94 private:
       
    95 
       
    96 	CUid();
       
    97 
       
    98 	/**
       
    99 	 * The second-phase constructor.
       
   100 	 *
       
   101 	 * @param aDataProvider		 An instance of a MSisDataProvider to read the entity from.
       
   102 	 * @param aTypeReadBehaviour Whether we need to check the sis type or not.
       
   103 	 */
       
   104 	void ConstructL(MSisDataProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour);
       
   105 
       
   106 	/**
       
   107 	 * The second-phase in place constructor.
       
   108 	 *
       
   109 	 * @param aDataProvider		 An instance of a TPtrProvider to read the entity from.
       
   110 	 * @param aTypeReadBehaviour Whether we need to check the sis type or not.
       
   111 	 */
       
   112 	
       
   113 	void ConstructL(TPtrProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour);
       
   114 	
       
   115 
       
   116 public:
       
   117 
       
   118 	/**
       
   119 	 * This function returns the actual uid.
       
   120 	 * 
       
   121 	 * @return The actual underlying Uid value
       
   122 	 */
       
   123 	inline TUid Uid() const;
       
   124 
       
   125 private:
       
   126 	/**
       
   127 	 * The first uid.
       
   128 	 */
       
   129 	TUid iUid;
       
   130 	};
       
   131 
       
   132 
       
   133 // inline functions from CUid
       
   134 
       
   135 TUid CUid::Uid() const
       
   136 	{
       
   137 	return iUid;
       
   138 	}
       
   139 
       
   140  } // namespace Sis
       
   141 } //namespace Swi
       
   142 
       
   143 
       
   144 
       
   145 #endif