MCPcopy Create free account
hub / github.com/ZDoom/Raze / StripLeft

Method StripLeft

source/common/utility/zstring.cpp:715–743  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

713}
714
715void FString::StripLeft ()
716{
717 size_t max = Len(), i, j;
718 if (max == 0) return;
719 for (i = 0; i < max; ++i)
720 {
721 if (!isspace((unsigned char)Chars[i]))
722 break;
723 }
724 if (i == 0)
725 { // Nothing to strip.
726 return;
727 }
728 if (Data()->RefCount <= 1)
729 {
730 for (j = 0; i <= max; ++j, ++i)
731 {
732 Chars[j] = Chars[i];
733 }
734 ReallocBuffer (j-1);
735 }
736 else
737 {
738 FStringData *old = Data();
739 AllocBuffer (max - i);
740 StrCopy (Chars, old->Chars() + i, max - i);
741 old->Release();
742 }
743}
744
745void FString::StripLeft (const FString &charset)
746{

Callers 1

StringStripLeftFunction · 0.80

Calls 2

CharsMethod · 0.80
ReleaseMethod · 0.45

Tested by

no test coverage detected