genericservices/httputils/inc/inetprottextutils.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 01 Apr 2010 00:15:09 +0300
branchRCL_3
changeset 15 18da5738c9b6
parent 0 e4d67989cc36
permissions -rw-r--r--
Revision: 201011 Kit: 201013

// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "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:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// 
// 
//

/**
 @file inetprottextutils.h
 @publishedAll
 @released
*/

#ifndef __INETPROTTEXTUTILS_H__
#define __INETPROTTEXTUTILS_H__

#include <e32base.h>

/**
	Comments :
@publishedAll
@released
*/
class InetProtTextUtils
	{
public:	// Enums

/**	
	enum TRemoveMode
	Enum defining whitespace removal modes.
 */
	enum TRemoveMode
		{
		/** 
			Specifies removal any contiguous whitespace characters at the 
			beginning of some data.
		*/ 
		ERemoveLeft		= 0,
		/** 
			Specifies removal any contiguous whitespace characters at the end of
			some data.
		*/ 
		ERemoveRight,
		/** 
			Specifies removal any contiguous whitespace characters at the 
			beginning and end of some data.
		*/ 
		ERemoveBoth
		};

public:	// Methods
	
	IMPORT_C static TInt RemoveWhiteSpace(TPtrC8& aData, TRemoveMode aMode);
	IMPORT_C static TInt RemoveWhiteSpace(TPtrC16& aData, TRemoveMode aMode);

	IMPORT_C static void ConvertIntToDescriptorL(TInt aInt, HBufC8*& aBuffer);
	IMPORT_C static void ConvertIntToDescriptorL(TInt aInt, HBufC16*& aBuffer);

	IMPORT_C static void ConvertHexToDescriptorL(TInt aHex, HBufC8*& aBuffer);
	IMPORT_C static void ConvertHexToDescriptorL(TInt aHex, HBufC16*& aBuffer);

	IMPORT_C static TInt ConvertDescriptorToInt(const TDesC8& aData, TInt& aInt);
	IMPORT_C static TInt ConvertDescriptorToInt(const TDesC16& aData, TInt& aInt);

	IMPORT_C static TInt ConvertDescriptorToHex(const TDesC8& aData, TInt& aHex);
	IMPORT_C static TInt ConvertDescriptorToHex(const TDesC16& aData, TInt& aHex);

	IMPORT_C static TInt ExtractNextTokenFromList(TPtrC8& aBuffer, TPtrC8& aToken, TChar aSeparator);
	IMPORT_C static TInt ExtractNextTokenFromList(TPtrC16& aBuffer, TPtrC16& aToken, TChar aSeparator);

	IMPORT_C static TInt ExtractNextTokenFromList(TPtrC8& aBuffer, TPtrC8& aToken, const TDesC8& aSeparators);
	IMPORT_C static TInt ExtractNextTokenFromList(TPtrC16& aBuffer, TPtrC16& aToken, const TDesC16& aSeparators);

	IMPORT_C static TInt ExtractQuotedStringL(TPtrC8& aBuffer, TPtrC8& aQuotedString);
	IMPORT_C static TInt ExtractQuotedStringL(TPtrC16& aBuffer, TPtrC16& aQuotedString);

	IMPORT_C static TInt ExtractIntegerValueL(TPtrC8& aBuffer, TInt& aIntVal, TBool aAllowNonWsTerminator);
	};

#endif	// __INETPROTTEXTUTILS_H__