MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / substr

Method substr

tests/framework/src/doctest.cpp:663–669  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

661}
662
663String String::substr(size_type pos, size_type cnt) && {
664 cnt = std::min(cnt, size() - 1 - pos);
665 char* cptr = c_str();
666 memmove(cptr, cptr + pos, cnt);
667 setSize(cnt);
668 return std::move(*this);
669}
670
671String String::substr(size_type pos, size_type cnt) const & {
672 cnt = std::min(cnt, size() - 1 - pos);

Callers 7

string to_stringMethod · 0.45
doctest.cppFile · 0.45
test_run_startMethod · 0.45
test_run_endMethod · 0.45
toStringFunction · 0.45

Calls 4

minFunction · 0.50
sizeFunction · 0.50
c_strFunction · 0.50
moveFunction · 0.50

Tested by

no test coverage detected