|
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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #if !defined(AFX_SDCINPUT_H__A0DBE2E4_6216_468F_8437_4BA19D0ACB09__INCLUDED_) |
|
20 #define AFX_SDCINPUT_H__A0DBE2E4_6216_468F_8437_4BA19D0ACB09__INCLUDED_ |
|
21 |
|
22 #if _MSC_VER > 1000 |
|
23 #pragma once |
|
24 #endif // _MSC_VER > 1000 |
|
25 |
|
26 #include <stdio.h> |
|
27 |
|
28 #include "SDCException.h" |
|
29 #include "SDCData.h" |
|
30 |
|
31 class CSDCInput |
|
32 { |
|
33 public: |
|
34 CSDCInput(); |
|
35 virtual ~CSDCInput(); |
|
36 |
|
37 public: |
|
38 void Open( const char* aFilename ); |
|
39 |
|
40 public: |
|
41 bool NextToken(); |
|
42 bool NextTokenAllowLF(); |
|
43 bool NextStringToken(); |
|
44 // @return The token count |
|
45 int NextRawToken(); |
|
46 |
|
47 public: |
|
48 static int ConvertToNumber( const wchar_t* aToken ); |
|
49 static void ConvertToAscii( char* aTarget, const wchar_t* aSource ); |
|
50 static void ConvertToAsciiWithCPPEscapes( char* aTarget, const wchar_t* aSource ); |
|
51 static TSDCColorDepth ConvertToColorDepth( const wchar_t* aToken ); |
|
52 static int ConvertToLayer( const wchar_t* aToken ); |
|
53 static bool IsSvgFile( const wchar_t* aFilename ); |
|
54 |
|
55 private: |
|
56 void RawRead(); |
|
57 bool ReadNextChar(); |
|
58 bool ParseToken( const wchar_t* aSeparators, const wchar_t* aTerminators ); |
|
59 |
|
60 public: |
|
61 FILE* iFile; |
|
62 int iLineNumber; |
|
63 bool iUnicode; |
|
64 bool iFirstInLine; |
|
65 |
|
66 wint_t iNextChar; |
|
67 wchar_t iToken[512]; |
|
68 int iHash; |
|
69 }; |
|
70 |
|
71 #endif // !defined(AFX_SDCINPUT_H__A0DBE2E4_6216_468F_8437_4BA19D0ACB09__INCLUDED_) |