MCPcopy Create free account
hub / github.com/SOUI2/soui / indentText

Method indentText

third-part/jsoncpp/src/test_lib_json/jsontest.cpp:182–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182JSONCPP_STRING TestResult::indentText(const JSONCPP_STRING& text,
183 const JSONCPP_STRING& indent) {
184 JSONCPP_STRING reindented;
185 JSONCPP_STRING::size_type lastIndex = 0;
186 while (lastIndex < text.size()) {
187 JSONCPP_STRING::size_type nextIndex = text.find('\n', lastIndex);
188 if (nextIndex == JSONCPP_STRING::npos) {
189 nextIndex = text.size() - 1;
190 }
191 reindented += indent;
192 reindented += text.substr(lastIndex, nextIndex - lastIndex + 1);
193 lastIndex = nextIndex + 1;
194 }
195 return reindented;
196}
197
198TestResult& TestResult::addToLastFailure(const JSONCPP_STRING& message) {
199 if (messageTarget_ != 0) {

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected