MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / calcLength

Method calcLength

Bcore/src/main/cpp/Dobby/tests/catch.hpp:5113–5138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5111 }
5112
5113 void calcLength() {
5114 assert(m_stringIndex < m_column.m_strings.size());
5115
5116 m_suffix = false;
5117 auto width = m_column.m_width - indent();
5118 m_end = m_pos;
5119 while (m_end < line().size() && line()[m_end] != '\n')
5120 ++m_end;
5121
5122 if (m_end < m_pos + width) {
5123 m_len = m_end - m_pos;
5124 } else {
5125 size_t len = width;
5126 while (len > 0 && !isBoundary(m_pos + len))
5127 --len;
5128 while (len > 0 && isWhitespace(line()[m_pos + len - 1]))
5129 --len;
5130
5131 if (len > 0) {
5132 m_len = len;
5133 } else {
5134 m_suffix = true;
5135 m_len = width - 1;
5136 }
5137 }
5138 }
5139
5140 auto indent() const -> size_t {
5141 auto initial = m_pos == 0 && m_stringIndex == 0 ? m_column.m_initialIndent : std::string::npos;

Callers

nothing calls this directly

Calls 2

isWhitespaceFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected