OSDN Git Service

import
[hos/hos-v4a.git] / cfgrtr / include / read.h
1 // ---------------------------------------------------------------------------
2 //  HOS V4 コンフィギュレーター Ver 1.00                                      
3 //    データ読み込みクラス                                                    
4 //                                                                            
5 //                                    Copyright (C) 1998-2002 by Project HOS  
6 //                                    http://sourceforge.jp/projects/hos/     
7 // ---------------------------------------------------------------------------
8
9
10
11 #ifndef __HOSV4CFG_Read_h__
12 #define __HOSV4CFG_Read_h__
13
14
15 #define READ_MAX_PATH           1024    // 最大パス名
16 #define READ_MAX_STATE          4096    // 1ステートの最大文字数
17
18
19 // データ読み込みクラス
20 class CRead
21 {
22 public:
23         CRead(FILE *fp, const char *name);                      // コンストラクタ
24         ~CRead();                                               // デストラクタ
25
26         int ReadState(char *szState);   // 1ステート読み込み
27         int GetPhysicalLineNum(void)    // 実際に読み込み中のファイルの行番号取得
28         { return m_iPhysicalLineNum; }
29         int GetLogicalLineNum(void)     // cppを通す前のファイルの行番号取得
30         { return m_iLogicalLineNum; }
31         const char *GetLogicalInputFile(void)
32         { return m_szLogicalInputFile; }
33
34 protected:
35        int SkipPreProcessorLine(char* szText, int iCount);     // プリプロセッサラインのスキップ
36         int ReadString(int cDelimiter, char* szText, int& iCount);      // 文字列読み込み
37
38         FILE *m_fpRead;                                 // 読み込み用ファイルポインタ
39         int  m_iPhysicalLineNum;                        // 実際に読み込み中のファイルの行番号
40         int  m_iLogicalLineNum;                         // cppを通す前のファイルの行番号
41         bool m_blLineTop;                               // 行の先頭
42         char m_szLogicalInputFile[READ_MAX_PATH];       // cppを通す前のファイル名
43 };
44
45
46 #endif  // __HOSV4CFG_Read_h__
47
48
49 // ---------------------------------------------------------------------------
50 //  Copyright (C) 1998-2002 by Project HOS                                    
51 // ---------------------------------------------------------------------------