MCPcopy Create free account
hub / github.com/Duet3D/RepRapFirmware / ReadChar

Method ReadChar

src/GCodes/GCodeBuffer/ExpressionParser.cpp:49–63  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
49void 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
65void LineReader::SkipTabsAndSpaces() noexcept
66{

Callers 1

THROWSFunction · 0.45

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected