zeroconf/dnsparser/inc/cstringparser.h
changeset 14 da856f45b798
equal deleted inserted replaced
12:78fbd574edf4 14:da856f45b798
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __CSTRINGPARSER_H__
       
    20 #define __CSTRINGPARSER_H__
       
    21 
       
    22 // String parser class to parse a string incremently
       
    23 class CStringParser : public CBase
       
    24     {
       
    25 public:
       
    26 	static CStringParser* NewL  ( const TDesC8& aBuffer );
       
    27 
       
    28 	virtual ~CStringParser ();	
       
    29 
       
    30 	TBool GetNextCharacter ( TChar& aChar );
       
    31 	TBool GetCurrentCharacter ( TChar& aChar );
       
    32 	TBool ParseTill ( TPtrC8& aWord, TChar aEndChar );
       
    33 	void ParseTill ( TPtrC8& aWord, const TDesC8& aCharSet );
       
    34 	
       
    35 	TBool SkipLength ( TInt aLen );
       
    36 
       
    37 	void GetRemainder ( TPtrC8& aBuffer );
       
    38 protected:
       
    39 	CStringParser ( const TDesC8& aBuffer );
       
    40 	
       
    41 private:
       
    42 	void IncrementCurrentPos ();
       
    43 	
       
    44 private:
       
    45 	const TDesC8& iBuffer;
       
    46 	TInt iCurrentPos;
       
    47     };
       
    48 
       
    49 #endif // __CSTRINGPARSER_H__