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

Method Peek

src/core/string_consumer.cpp:86–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86std::string_view StringConsumer::Peek(size_type len) const
87{
88 auto buf = this->src.substr(this->position);
89 if (len == std::string_view::npos) {
90 len = buf.size();
91 } else if (len > buf.size()) {
92 len = buf.size();
93 }
94 return buf.substr(0, len);
95}
96
97void StringConsumer::Skip(size_type len)
98{

Callers 4

ReadMethod · 0.95
PeekUntilCharInMethod · 0.95
PeekUntilCharNotInMethod · 0.95

Calls 2

substrMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected