rpad.cc
Go to the documentation of this file.
1 // ======================================================================
2 //
3 // rpad: Right-pad a string to the wanted size, unless already longer
4 //
5 // ======================================================================
6 
7 #include "cetlib/rpad.h"
8 
11  std::string::size_type wanted_size,
12  char char_to_pad_with)
13 {
14  if (wanted_size <= s.size())
15  return s; // already long enough
16 
18  return result.append(wanted_size - s.size(), char_to_pad_with);
19 
20 } // rpad()
21 
22 // ======================================================================
static QCString result
std::string string
Definition: nybbler.cc:12
std::string rpad(std::string const &pad_me, std::string::size_type wanted_size, char char_to_pad_with= ' ')
Definition: rpad.cc:10
static QCString * s
Definition: config.cpp:1042