examples/SysLibs/Streams/WriteToMany/WriteToMany.h

00001 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
00002 // All rights reserved.
00003 // This component and the accompanying materials are made available
00004 // under the terms of "Eclipse Public License v1.0"
00005 // which accompanies this distribution, and is available
00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00007 //
00008 // Initial Contributors:
00009 // Nokia Corporation - initial contribution.
00010 //
00011 // Contributors:
00012 //
00013 // Description:
00014 // Function and class definitions used in the 
00015 // WriteToMany example
00016 //
00017 
00018 #ifndef __WriteToMany_H
00019 #define __WriteToMany_H
00020 
00021 #include "CommonStreamStore.h"
00022 #include <s32file.h>
00023 
00024 static void doMakeAndStoreL(const TDesC& aName);
00025 static void doRestoreL(const TDesC& aName);
00026 
00027 class CClassA;
00028 static void doShow(const TDesC& aHeading,const CClassA& anA);
00029 
00030 class CClassB;
00031 static void doShow(const TDesC& aHeading,const CClassB& aB);
00032 
00033 class CClassC;
00034 static void doShow(const TDesC& aHeading,const CClassC& aC);
00035 
00036 
00037 class CClassA : public CBase
00038         {
00039 public :
00040         static CClassA* NewL();
00041         static CClassA* NewLC();
00042 public :
00043         ~CClassA();
00044         void     ExternalizeL(RWriteStream& aStream) const;
00045         void     InternalizeL(RReadStream& aStream);
00046 public :
00047         HBufC*   iVarBuf;
00048         TInt     iIntValue;
00049         TUint    iUintValue;
00050         };
00051 
00052 class CClassB : public CBase
00053         {
00054 public :
00055         static CClassB* NewL();
00056         static CClassB* NewLC();
00057 public :
00058         void     ExternalizeL(RWriteStream& aStream) const;
00059         void     InternalizeL(RReadStream& aStream);
00060 public :
00061         TBuf<32> iFixBuf;
00062         TUint    iUintValue;
00063         TInt     iIntValue;
00064         TReal    iRealValue;
00065         };
00066 
00067 class CClassC : public CBase
00068         {
00069 public  :
00070         static CClassC* NewL();
00071         static CClassC* NewLC();
00072 public  :
00073         void     ExternalizeL(RWriteStream& aStream) const;
00074         void     InternalizeL(RReadStream& aStream);
00075 public :
00076         TBuf<32> iFixBuf;
00077         };
00078 
00079 
00080 
00081 class CClassABC : public CBase
00082         {
00083 public :
00084         static CClassABC* NewLC(CStreamStore& aStore);
00085         static CClassABC* NewLC(CStreamStore& aStore, TStreamId anId);
00086 public :
00087         CClassABC(CStreamStore& aStore);
00088         CClassABC(CStreamStore& aStore,TStreamId anId);
00089         ~CClassABC();
00090         TStreamId         StoreL();
00091         void              RestoreL();
00092         void              ConstructAL(const TDesC& aData,TInt anInt,TUint aUint);
00093         void              ConstructB(const TDesC& aData,TInt anInt,TUint aUint,TReal aReal);
00094         void              ConstructC(const TDesC& aData);
00095         const CClassA*    PtrA();
00096         const CClassB*    PtrBL();
00097         const CClassC*    PtrC();
00098 private :
00099         void              ConstructL();
00100         void              RestoreBL();
00101 private :
00102         CClassA*          iA;
00103         TSwizzle<CClassB> iB;     // Note use of swizzle here
00104         CClassC*          iC;
00105         CStreamStore&     iStore; // Store to/Restore from this store
00106         TStreamId         iId;    // Restore from/replace this stream
00107         };
00108 
00109 #endif

Generated by  doxygen 1.6.2