46
|
1 |
/*
|
|
2 |
* Copyright (c) 2003 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: SVG Engine header file
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef __INC_TTokenizer__
|
|
20 |
#define __INC_TTokenizer__
|
|
21 |
|
|
22 |
#if !defined(__E32BASE_H__)
|
|
23 |
#include <e32base.h>
|
|
24 |
#endif
|
|
25 |
|
|
26 |
class TTokenizer
|
|
27 |
{
|
|
28 |
public:
|
|
29 |
TTokenizer( const TPtrC& aString );
|
|
30 |
|
|
31 |
TBool IsAtEnd();
|
|
32 |
TInt EndIndex();
|
|
33 |
|
|
34 |
TUint16 NextChar();
|
|
35 |
void Advance( TInt count = 1 );
|
|
36 |
|
|
37 |
TBool SkipWhiteSpace();
|
|
38 |
TBool SkipInteger();
|
|
39 |
TBool SkipDecimal();
|
|
40 |
TBool SkipHex();
|
|
41 |
|
|
42 |
TBool SkipUntilEnd( );
|
|
43 |
TBool SkipUntil( TUint16 aChar );
|
|
44 |
|
|
45 |
TBool StartsWith( const TDesC& aString );
|
|
46 |
|
|
47 |
TPtrC SkippedString();
|
|
48 |
|
|
49 |
TPtrC Remainder();
|
|
50 |
|
|
51 |
static TBool IsWhiteSpace( TUint16 aChar );
|
|
52 |
static TBool IsDigit( TUint16 aChar );
|
|
53 |
static TBool IsHexDigit( TUint16 aChar );
|
|
54 |
|
|
55 |
static TInt IndexOf( const TDesC& aString, TUint16 aChar );
|
|
56 |
|
|
57 |
// return a trim string at both ends
|
|
58 |
static TPtrC Trim( const TDesC& aString );
|
|
59 |
|
|
60 |
static TBool ParseDecimal( const TDesC& aString, TReal32& aValue, TPtrC& aRemainder );
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
private:
|
|
65 |
TPtrC iString;
|
|
66 |
TInt iCurrentIndex;
|
|
67 |
TInt iPreviousIndex;
|
|
68 |
|
|
69 |
};
|
|
70 |
|
|
71 |
|
|
72 |
#endif //__INC_TTokenizer__
|