smf/smfcredentialmgr/smfcredmgrcommon/inc/smfutils.h
author cgandhi <chandradeep.gandhi@sasken.com>
Wed, 23 Jun 2010 19:51:49 +0530
changeset 14 a469c0e6e7fb
permissions -rw-r--r--
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.

/**
 * Copyright (c) 2010 Sasken Communication Technologies Ltd.
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the "Eclipse Public License v1.0"
 * which accompanies  this distribution, and is available
 * at the URL "http://www.eclipse.org/legal/epl-v10.html"
 *
 * Initial Contributors:
 * Lasse Laasonen, Sasken Communication Technologies Ltd - Initial contribution
 *
 * Description:
 * This header contains utility routines used by server and client
 */

#ifndef SMFUTILS_H_
#define SMFUTILS_H_

#include <e32base.h>

class RWriteStream;
class RReadStream;

/**
 * Utility to serialize data
 */
namespace SmfUtils
	{
	/**
	 * Method to externalize
	 * @param aDes descriptor to be externalized
	 * @param aStream The Write Stream to be filled.
	 */
	void ExternalizeDesL(const TDesC8& aDes, RWriteStream& aStream);

	/**
	 * Method to internalize 
	 * @param aDes descriptor to be internalized
	 * @param aStream the stream to read from.
	 */
	TInt InternalizeDesL(RBuf8& aDes, RReadStream& aStream);

	/**
	 * Method to externalize
	 * @param aDes descriptor to be externalized
	 * @param aStream The Write Stream to be filled.
	 */
	void ExternalizeDesL(const TDesC16& aDes, RWriteStream& aStream);

	/**
	 * Method to internalize 
	 * @param aStream the stream to read from.
	 */
	HBufC16* InternalizeDesL(RReadStream& aStream);

	TInt InternalizeDesL( RBuf16& aDes, RReadStream& aStream );
	/**
	 * Method to externalize 
	 * @param aInt integer to be externalized
	 * @param aStream The Write Stream to be filled.
	 */
	void ExternalizeInt64L(const TInt64& aInt, RWriteStream& aStream);

	/**
	 * Method to internalize 
	 * @param aInt integer to be internalized
	 * @param aStream the stream to read from.
	 */
	void InternalizeInt64L(TInt64& aInt, RReadStream& aStream);
	}

#endif /* SMFUTILS_H_ */