We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9a9ad3 commit ea9be93Copy full SHA for ea9be93
openvpn/common/string.hpp
@@ -412,16 +412,22 @@ namespace openvpn {
412
return ret;
413
}
414
415
- // generate a string with spaces
416
- inline std::string spaces(int n)
+ // generate a string with n instances of char c
+ inline std::string repeat(const char c, int n)
417
{
418
std::string ret;
419
ret.reserve(n);
420
while (n-- > 0)
421
- ret += ' ';
+ ret += c;
422
423
424
425
+ // generate a string with spaces
426
+ inline std::string spaces(int n)
427
+ {
428
+ return repeat(' ', n);
429
+ }
430
+
431
// indent a multiline string
432
inline std::string indent(const std::string& str, const int first, const int remaining)
433
0 commit comments