1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/obexinternalutils.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,136 @@
1.4 +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// $Workfile: obexinternalutils.h $
1.18 +// $Author: Stevep $
1.19 +// $Revision: 1 $
1.20 +// $Date: 12/11/01 11:36 $
1.21 +//
1.22 +//
1.23 +
1.24 +#ifndef __OBEXINTERNALUTILS_H
1.25 +#define __OBEXINTERNALUTILS_H
1.26 +
1.27 +#include <e32base.h>
1.28 +class RReadStream;
1.29 +class RWriteStream;
1.30 +
1.31 +class ObexInternalUtils : public CBase
1.32 +/**
1.33 +Utility class containing on static member functions to provide internalize/externalize functionality to
1.34 +HBufC and HBufC8.
1.35 +
1.36 +@internalTechnology
1.37 +@released
1.38 +*/
1.39 + {
1.40 +public:
1.41 + ///Enumeration for panic codes
1.42 + enum TObexInternalUtilsPanic
1.43 + {
1.44 + EObexBadStreamVersion ///< Panic if stream version is incorrect
1.45 + };
1.46 +public:
1.47 +
1.48 + /**
1.49 + * Externalizes a HBufC to a stream.
1.50 + *
1.51 + * @param aBuf The HBufC to be externalized
1.52 + * @param aStream The stream to be written to
1.53 + * @leave KErrXXX Leaves with standard EPOC stream leave codes
1.54 + */
1.55 +
1.56 + IMPORT_C static void ExternalizeL(const HBufC* aBuf, RWriteStream& aStream);
1.57 +
1.58 + /**
1.59 + * Internalizes a HBufC from a stream.
1.60 + *
1.61 + * @param aBuf The HBufC to be internalized
1.62 + * @param aStream The stream to be read from
1.63 + * @leave KErrXXX Leaves with standard EPOC stream and memory allocation leave codes
1.64 + */
1.65 +
1.66 + IMPORT_C static void InternalizeL(HBufC*& aBuf, RReadStream& aStream);
1.67 +
1.68 + /**
1.69 + * Externalizes a HBufC8 to a stream.
1.70 + *
1.71 + * @param aBuf The HBufC8 to be externalized
1.72 + * @param aStream The stream to be written to
1.73 + * @leave KErrXXX Leaves with standard EPOC stream leave codes
1.74 + */
1.75 +
1.76 + IMPORT_C static void ExternalizeL(const HBufC8* aBuf, RWriteStream& aStream);
1.77 +
1.78 + /**
1.79 + * Internalizes a HBufC8 from a stream.
1.80 + *
1.81 + * @param aBuf The HBufC8 to be internalized
1.82 + * @param aStream The stream to be read from
1.83 + * @leave KErrXXX Leaves with standard EPOC stream and memory allocation leave codes
1.84 + */
1.85 +
1.86 + IMPORT_C static void InternalizeL(HBufC8*& aBuf, RReadStream& aStream);
1.87 +
1.88 + /**
1.89 + * Externalizes a TDes to a stream.
1.90 + *
1.91 + * @param aBuf The TDes to be externalized
1.92 + * @param aStream The stream to be written to
1.93 + * @leave KErrXXX Leaves with standard EPOC stream leave codes
1.94 + */
1.95 +
1.96 + IMPORT_C static void ExternalizeL(const TDes& aBuf, RWriteStream& aStream);
1.97 +
1.98 + /**
1.99 + * Internalizes a TDes from a stream.
1.100 + *
1.101 + * @param aDes The TDes to be internalized
1.102 + * @param aStream The stream to be read from
1.103 + * @leave KErrXXX Leaves with standard EPOC stream and memory allocation leave codes
1.104 + * @leave KErrOverflow if the incoming data is too big for the TBuf provided
1.105 + */
1.106 +
1.107 + IMPORT_C static void InternalizeL(TDes& aBuf, RReadStream& aStream);
1.108 +
1.109 + /**
1.110 + * Externalizes a TDes8 to a stream.
1.111 + *
1.112 + * @param aBuf The TDes8 to be externalized
1.113 + * @param aStream The stream to be written to
1.114 + * @leave KErrXXX Leaves with standard EPOC stream leave codes
1.115 + */
1.116 +
1.117 + IMPORT_C static void ExternalizeL(const TDes8& aBuf, RWriteStream& aStream);
1.118 +
1.119 + /**
1.120 + * Internalizes a TDes8 from a stream.
1.121 + *
1.122 + * @param aBuf The TDes8 to be internalized
1.123 + * @param aStream The stream to be read from
1.124 + * @leave KErrXXX Leaves with standard EPOC stream and memory allocation leave codes
1.125 + * @leave KErrOverflow if the incoming data is too big for the TBuf provided
1.126 + */
1.127 +
1.128 + IMPORT_C static void InternalizeL(TDes8& aBuf, RReadStream& aStream);
1.129 +
1.130 + /**
1.131 + * Indicates Panic originates from Obex MTM
1.132 + *
1.133 + * @param aPanic The type of TObexInternalUtilsPanic which has taken place
1.134 + */
1.135 +
1.136 + IMPORT_C static void Panic(TObexInternalUtilsPanic aPanic);
1.137 + };
1.138 +
1.139 +#endif//__OBEXINTERNALUTILS_H