MCPcopy Create free account
hub / github.com/crawl/crawl / _base_split_parse

Function _base_split_parse

crawl-ref/source/initfile.cc:3751–3771  ·  view source on GitHub ↗

ugh, this is still very messy. Calling this is quite verbose, hence the wrapper below.

Source from the content-addressed store, hash-verified

3749// ugh, this is still very messy. Calling this is quite verbose, hence the
3750// wrapper below.
3751static void _base_split_parse(const string &s,
3752 const string &separator,
3753 function<void(const string &, bool)> modify,
3754 bool prepend=false)
3755{
3756 // Lots of things use split parse, for some ^= and += should do different things,
3757 // for others they should not. Split parse just passes them along.
3758 // this does not allow escaping `separator`, because it doesn't seem like
3759 // any of the callers currently should need it
3760 const vector<string> defs = split_string(separator, s);
3761 if (prepend)
3762 {
3763 for (auto it = defs.rbegin(); it != defs.rend(); ++it)
3764 modify(*it, prepend);
3765 }
3766 else
3767 {
3768 for (auto it = defs.begin(); it != defs.end(); ++it)
3769 modify(*it, prepend);
3770 }
3771}
3772
3773void game_options::split_parse(const opt_parse_state &state,
3774 const string &separator,

Callers 2

split_parseMethod · 0.85
read_option_lineMethod · 0.85

Calls 3

split_stringFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected