MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / operator+

Function operator+

Engine/source/core/util/str.cpp:793–811  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

791//-----------------------------------------------------------------------------
792
793String operator+(const String &a, const String &b)
794{
795 PROFILE_SCOPE( String_String_plus_String );
796
797 if( a.isEmpty() )
798 return b;
799 else if( b.isEmpty() )
800 return a;
801
802 U32 lena = a.length();
803 U32 lenb = b.length();
804
805 String::StringData* sub = String::StringData::Create(NULL, lena + lenb);
806
807 String::copy(sub->utf8(),a._string->utf8(),lena);
808 String::copy(sub->utf8() + lena,b._string->utf8(),lenb + 1);
809
810 return String(sub);
811}
812
813String operator+(const String &a, StringChar c)
814{

Callers

nothing calls this directly

Calls 6

CreateFunction · 0.85
StringClass · 0.70
dStrlenFunction · 0.50
isEmptyMethod · 0.45
lengthMethod · 0.45
utf8Method · 0.45

Tested by

no test coverage detected