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

Method SkipUntil

src/core/string_consumer.hpp:733–749  ·  view source on GitHub ↗

* Skip data until the first occurrence of 'str'. * @param str Separator string. * @param sep Whether to also skip 'str'. */

Source from the content-addressed store, hash-verified

731 * @param sep Whether to also skip 'str'.
732 */
733 void SkipUntil(std::string_view str, SeparatorUsage sep)
734 {
735 assert(!str.empty());
736 this->Skip(this->Find(str));
737 switch (sep) {
738 default:
739 break;
740 case READ_ONE_SEPARATOR:
741 case SKIP_ONE_SEPARATOR:
742 this->SkipIf(str);
743 break;
744 case READ_ALL_SEPARATORS:
745 case SKIP_ALL_SEPARATORS:
746 while (this->ReadIf(str)) {}
747 break;
748 }
749 }
750
751 /**
752 * Peek data until the first occurrence of 8-bit char 'c'.

Callers 1

SkipUntilCharMethod · 0.95

Calls 5

SkipMethod · 0.95
FindMethod · 0.95
SkipIfMethod · 0.95
ReadIfMethod · 0.95
emptyMethod · 0.45

Tested by

no test coverage detected