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

Function padded_str

crawl-ref/source/stringutil.cc:122–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122string padded_str(const string &s, int pad_to, bool prepend)
123{
124 const int padding = pad_to - codepoints(s);
125 if (padding <= 0)
126 return s;
127 string str = s;
128 if (prepend)
129 str.insert(0, string(padding, ' '));
130 else
131 str.append(padding, ' ');
132 return str;
133}
134
135int ends_with(const string &s, const char * const suffixes[])
136{

Callers 3

_format_dbrandFunction · 0.85
_build_table_of_attacksFunction · 0.85
PrintMethod · 0.85

Calls 3

codepointsFunction · 0.85
insertMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected