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