MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / SkipIntegerBase

Method SkipIntegerBase

src/core/string_consumer.cpp:174–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174void StringConsumer::SkipIntegerBase(int base)
175{
176 this->SkipIf("-");
177 if (base == 0) {
178 if (this->ReadIf("0x") || this->ReadIf("0X")) { // boolean short-circuit ensures only one prefix is read
179 base = 16;
180 } else {
181 base = 10;
182 }
183 }
184 switch (base) {
185 default:
186 assert(false);
187 break;
188 case 8:
189 this->SkipUntilCharNotIn("01234567");
190 break;
191 case 10:
192 this->SkipUntilCharNotIn("0123456789");
193 break;
194 case 16:
195 this->SkipUntilCharNotIn("0123456789abcdefABCDEF");
196 break;
197 }
198}

Callers 3

TryReadIntegerBaseMethod · 0.95
ReadIntegerBaseMethod · 0.95

Calls 3

SkipIfMethod · 0.95
ReadIfMethod · 0.95
SkipUntilCharNotInMethod · 0.95

Tested by

no test coverage detected