Read a character from the text file. If we reach end of line or end of file, set currentCharacter to 0 and set fileFinished to true. Else increment the character count and set currentCharacter to the character we read.
| 47 | // If we reach end of line or end of file, set currentCharacter to 0 and set fileFinished to true. |
| 48 | // Else increment the character count and set currentCharacter to the character we read. |
| 49 | void LineReader::ReadChar() noexcept |
| 50 | { |
| 51 | if (!fileFinished) |
| 52 | { |
| 53 | fileFinished = (!f->Read(currentCharacter) || currentCharacter == '\r' || currentCharacter == '\n'); |
| 54 | } |
| 55 | if (fileFinished) |
| 56 | { |
| 57 | currentCharacter = 0; |
| 58 | } |
| 59 | else |
| 60 | { |
| 61 | ++charsRead; |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | void LineReader::SkipTabsAndSpaces() noexcept |
| 66 | { |