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

Method insert

modules/gui/gui/src/backend/text_server/ustring.cpp:3400–3425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3398}
3399
3400String String::insert(int p_at_pos, const String& p_string) const
3401{
3402 if (p_at_pos < 0)
3403 {
3404 return *this;
3405 }
3406
3407 if (p_at_pos > length())
3408 {
3409 p_at_pos = length();
3410 }
3411
3412 String pre;
3413 if (p_at_pos > 0)
3414 {
3415 pre = substr(0, p_at_pos);
3416 }
3417
3418 String post;
3419 if (p_at_pos < length())
3420 {
3421 post = substr(p_at_pos, length() - p_at_pos);
3422 }
3423
3424 return pre + p_string + post;
3425}
3426
3427String String::substr(int p_from, int p_chars) const
3428{

Callers 12

pad_zerosMethod · 0.45
get_string_sizeMethod · 0.45
draw_stringMethod · 0.45
draw_multiline_stringMethod · 0.45
draw_string_outlineMethod · 0.45
_insert_featureMethod · 0.45

Calls 2

substrFunction · 0.85
lengthFunction · 0.50

Tested by

no test coverage detected