MCPcopy Create free account
hub / github.com/KDE/kdiff3 / cut_to_length

Method cut_to_length

diff_ext_for_kdiff3/diff_ext.cpp:440–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

438}
439
440tstring
441DIFF_EXT::cut_to_length(const tstring& in, size_t max_len)
442{
443 tstring ret;
444 if(in.length() > max_len)
445 {
446 ret = in.substr(0, (max_len - 3) / 2);
447 ret += TEXT("...");
448 ret += in.substr(in.length() - (max_len - 3) / 2);
449 }
450 else
451 {
452 ret = in;
453 }
454
455 return ret;
456}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected