MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / erase

Method erase

source/core/StarString.cpp:763–777  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

761}
762
763void String::erase(size_t pos, size_t n) {
764 String ns;
765 ns.reserve(m_string.size() - std::min(n, m_string.size()));
766 auto it = begin();
767 for (size_t i = 0; i < pos; ++i)
768 ns.append(*it++);
769 for (size_t i = 0; i < n; ++i) {
770 if (it == end())
771 break;
772 ++it;
773 }
774 while (it != end())
775 ns.append(*it++);
776 *this = ns;
777}
778
779String String::padLeft(size_t size, String const& filler) const {
780 if (!filler.length())

Callers 15

handleIncomingPacketsMethod · 0.45
updateMethod · 0.45
readNetTileMethod · 0.45
setGenericPropertyMethod · 0.45
handleIncomingPacketsMethod · 0.45
setPropertyMethod · 0.45
resetMethod · 0.45
handleWorldMessagesMethod · 0.45
removeChildMethod · 0.45
removeChildAtMethod · 0.45
updateMethod · 0.45
clearSpeakersMethod · 0.45

Calls 5

beginFunction · 0.85
endFunction · 0.85
reserveMethod · 0.45
sizeMethod · 0.45
appendMethod · 0.45

Tested by 13

shiftLeftMethod · 0.36
shiftRightMethod · 0.36
splitMethod · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
StripTrailingSpacesFunction · 0.36
NormalizeMethod · 0.36
OnThreadExitMethod · 0.36