diff options
author | Stijn Buys <ingar@osirion.org> | 2008-07-16 22:55:07 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-07-16 22:55:07 +0000 |
commit | eb075660e7cb61b138c2da337115c59857f89e17 (patch) | |
tree | 0fe031a8f3562b22f61d0f95b740fe5f2326fd7b /src/auxiliary/functions.cc | |
parent | fecc54ad8c5a108831c2bc268f9dd7e16b511b7e (diff) |
network protocol cleanup, radar test (doesn't work)
Diffstat (limited to 'src/auxiliary/functions.cc')
-rw-r--r-- | src/auxiliary/functions.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/auxiliary/functions.cc b/src/auxiliary/functions.cc index 5edff56..dbfc799 100644 --- a/src/auxiliary/functions.cc +++ b/src/auxiliary/functions.cc @@ -96,7 +96,7 @@ const std::string text_strip_lowercase(const std::string &text) return r; } -const std::string spaces(const std::string &text,size_t n) +const std::string pad_left(const std::string &text,size_t n) { size_t l = text_length(text); if (n <= l) @@ -108,6 +108,17 @@ const std::string spaces(const std::string &text,size_t n) return s; } +const std::string pad_right(const std::string &text,size_t n) +{ + size_t l = text_length(text); + if (n <= l) + return text; + + std::string s(text); + s.append(n-l, ' '); + return s; +} + void to_lowercase(std::string &text) { for (std::string::iterator i = text.begin(); i != text.end(); ++i) |