Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
cetlib
cetlib
lpad.cc
Go to the documentation of this file.
1
// ======================================================================
2
//
3
// lpad: Left-pad a string to the wanted size, unless already longer
4
//
5
// ======================================================================
6
7
#include "
cetlib/lpad.h
"
8
9
std::string
10
cet::lpad
(
std::string
const
&
s
,
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
17
std::string
result
(wanted_size - s.size(), char_to_pad_with);
18
return
result
.
append
(s);
19
20
}
// lpad()
21
22
// ======================================================================
result
static QCString result
Definition:
fortranscanner.cpp:56614
string
std::string string
Definition:
nybbler.cc:12
cet::lpad
std::string lpad(std::string const &pad_me, std::string::size_type wanted_size, char char_to_pad_with= ' ')
Definition:
lpad.cc:10
lpad.h
s
static QCString * s
Definition:
config.cpp:1042
QCString::append
QCString & append(const char *s)
Definition:
qcstring.cpp:383
Generated by
1.8.11