13 const unsigned TextFileBufferSize = 256;
\r
18 // no default c'tor, not implemented
\r
22 virtual ~TextFile();
\r
24 TextFile(const char szFileName[], bool bWrite = false);
\r
25 TextFile(FILE *ptrFile, const char *ptrFileName = "-");
\r
26 void Close() { fclose(m_ptrFile); m_ptrFile = 0; }
\r
28 bool GetLine(char szLine[], unsigned uBytes);
\r
29 bool GetTrimLine(char szLine[], unsigned uBytes);
\r
30 void GetLineX(char szLine[], unsigned uBytes);
\r
32 bool GetToken(char szToken[], unsigned uBytes, const char szCharTokens[] = "{}");
\r
33 void GetTokenX(char szToken[], unsigned uBytes, const char szCharTokens[] = "{}");
\r
40 TEXTFILEPOS GetPos();
\r
41 void SetPos(TEXTFILEPOS Pos);
\r
42 bool GetChar(char &c);
\r
43 void GetCharX(char &c);
\r
44 void GetNonblankChar(char &c);
\r
46 unsigned GetLineNr() { return m_uLineNr; }
\r
48 void PutString(const char szLine[]);
\r
49 void PutFormat(const char szFormat[], ...);
\r
50 void PutChar(char c);
\r
52 const char *GetFileName() { return m_ptrName; }
\r
54 void PushBack(int c) { m_cPushedBack = c; }
\r
56 FILE *GetStdioFile() const { return m_ptrFile; }
\r
59 void Init(FILE *ptrFile, const char *ptrFileName);
\r
66 bool m_bLastCharWasEOL;
\r
70 #endif // TextFile_h
\r