MCPcopy Create free account
hub / github.com/davisking/dlib / pad

Function pad

dlib/string/string.h:767–777  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

765 typename alloc
766 >
767 const std::basic_string<charT,traits,alloc> pad (
768 const std::basic_string<charT,traits,alloc>& str,
769 long pad_length,
770 const std::basic_string<charT,traits,alloc>& pad_string
771 )
772 {
773 const long str_size = static_cast<long>(str.size());
774 return rpad(lpad(str,(pad_length-str_size)/2 + str_size,pad_string),
775 pad_length,
776 pad_string);
777 }
778
779 template <
780 typename charT,

Callers 1

string_testFunction · 0.85

Calls 3

rpadFunction · 0.85
lpadFunction · 0.85
sizeMethod · 0.45

Tested by 1

string_testFunction · 0.68