MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / mid

Function mid

lite/load_and_run/src/helpers/text_table.cpp:6–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4
5namespace {
6inline void mid(std::ostream& os, const std::string& str, size_t max_w) {
7 size_t l = (max_w - str.length()) / 2 + str.length();
8 size_t r = max_w - l;
9 os << std::setw(l) << std::right << str;
10 if (r > 0)
11 os << std::setw(r) << ' ';
12}
13inline size_t char_length(char c) {
14 return c ? 1 : 0;
15}

Callers 1

showMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected