MCPcopy Create free account
hub / github.com/ComodoSecurity/openedr / indentText

Method indentText

edrav2/eprj/jsoncpp/src/test_lib_json/jsontest.cpp:170–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170JSONCPP_STRING TestResult::indentText(const JSONCPP_STRING& text,
171 const JSONCPP_STRING& indent) {
172 JSONCPP_STRING reindented;
173 JSONCPP_STRING::size_type lastIndex = 0;
174 while (lastIndex < text.size()) {
175 JSONCPP_STRING::size_type nextIndex = text.find('\n', lastIndex);
176 if (nextIndex == JSONCPP_STRING::npos) {
177 nextIndex = text.size() - 1;
178 }
179 reindented += indent;
180 reindented += text.substr(lastIndex, nextIndex - lastIndex + 1);
181 lastIndex = nextIndex + 1;
182 }
183 return reindented;
184}
185
186TestResult& TestResult::addToLastFailure(const JSONCPP_STRING& message) {
187 if (messageTarget_ != nullptr) {

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
findMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected