MCPcopy Create free account
hub / github.com/MikeMirzayanov/testlib / readStringTo

Method readStringTo

testlib.h:4121–4149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4119}
4120
4121void InStream::readStringTo(std::string &result) {
4122 if (NULL == reader)
4123 quit(_pe, "Expected line");
4124
4125 result.clear();
4126
4127 for (;;) {
4128 int cur = reader->curChar();
4129
4130 if (cur == LF || cur == EOFC)
4131 break;
4132
4133 if (cur == CR) {
4134 cur = reader->nextChar();
4135 if (reader->curChar() == LF) {
4136 reader->unreadChar(cur);
4137 break;
4138 }
4139 }
4140
4141 lastLine = reader->getLine();
4142 result += char(reader->nextChar());
4143 }
4144
4145 if (strict)
4146 readEoln();
4147 else
4148 eoln();
4149}
4150
4151std::string InStream::readString() {
4152 readStringTo(_tmpReadToken);

Callers

nothing calls this directly

Calls 10

quitFunction · 0.70
__testlib_partFunction · 0.70
vtosFunction · 0.70
patternClass · 0.70
curCharMethod · 0.45
nextCharMethod · 0.45
unreadCharMethod · 0.45
getLineMethod · 0.45
matchesMethod · 0.45
srcMethod · 0.45

Tested by

no test coverage detected