epoc32/include/pcstore/checkeduid.h
branchSymbian3
changeset 4 837f303aceeb
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #if !defined(__CHECKEDUID_H__)
       
    17 #define __CHECKEDUID_H__
       
    18 
       
    19 #include <pcstore/pcstoredef.h>
       
    20 #include <pcstore/uid.h>
       
    21 
       
    22 namespace PCStore
       
    23 {
       
    24 class CDes8;
       
    25 
       
    26 /**
       
    27 @internalComponent
       
    28 
       
    29 Encapsulates a set of three unique identifiers (UIDs) which, in combination, 
       
    30 identify a system object such as a GUI application or a DLL. The three
       
    31 component UIDs are referred to as UID1, UID2 and UID3.
       
    32 
       
    33 An object of this type is referred to as a compound identifier or a UID type.
       
    34 */
       
    35 class TUidType
       
    36 	{
       
    37 public:
       
    38 	TUidType();
       
    39 	TUidType(TUid aUid1);
       
    40 	TUidType(TUid aUid1, TUid aUid2);
       
    41 	TUidType(TUid aUid1, TUid aUid2, TUid aUid3);
       
    42 	TBool operator !=(const TUidType& aUidType) const;
       
    43 	TBool operator ==(const TUidType& aUidType) const ;
       
    44 	const TUid& operator[](TInt aIndex) const;
       
    45 	TBool IsValid() const ;
       
    46 
       
    47 private:
       
    48 	TUid MostDerived() const;
       
    49 
       
    50 private:
       
    51 	TUid iUid[3];
       
    52 	};
       
    53 
       
    54 
       
    55 /**
       
    56 @internalComponent
       
    57 
       
    58 Packages a Uid type together with a checksum.
       
    59 
       
    60 @see TUidType
       
    61 */
       
    62 class TCheckedUid
       
    63 	{
       
    64 public:
       
    65 	TCheckedUid();
       
    66 	TCheckedUid(const TUidType& aUidType);
       
    67 	TCheckedUid(const CDes8& aDes);
       
    68 	
       
    69 	void Set(const TUidType& aUidType);
       
    70 	void Set(const CDes8& aDes);
       
    71 	CDes8 Des() const;
       
    72 	const TUidType&  UidType() const;
       
    73 
       
    74 private:
       
    75 	TUint Check() const;
       
    76 
       
    77 private:
       
    78 	TUidType iType;
       
    79 	TUint32 iCheck;
       
    80 	};
       
    81 
       
    82 class CStoreWriteStream;
       
    83 CStoreWriteStream& operator<<(CStoreWriteStream& aStream,const TCheckedUid& aUid);
       
    84 
       
    85 class CStoreReadStream;
       
    86 CStoreReadStream& operator>>(CStoreReadStream& aStream, TCheckedUid& aUid);
       
    87 }
       
    88 #endif // !defined(__CHECKEDUID_H__)