diff options
Diffstat (limited to 'src/auxiliary/functions.cc')
-rw-r--r-- | src/auxiliary/functions.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/auxiliary/functions.cc b/src/auxiliary/functions.cc index 8cefbc5..5dbc012 100644 --- a/src/auxiliary/functions.cc +++ b/src/auxiliary/functions.cc @@ -13,7 +13,7 @@ const std::string plural(const char * word, size_t n) { std::string p(word); - if (n != 1) + if (n != 1) p += 's'; return p; } @@ -96,40 +96,40 @@ const std::string text_strip_lowercase(const std::string &text) return r; } -const std::string pad_left(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) return text; std::string s; - s.assign(n-l, ' '); + s.assign(n - l, ' '); s.append(text); return s; } -const std::string pad_right(const std::string &text,size_t n) +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, ' '); + s.append(n - l, ' '); return s; } void to_lowercase(std::string &text) { - for (std::string::iterator i = text.begin(); i != text.end(); ++i) - (*i) = tolower(*i); + for (std::string::iterator i = text.begin(); i != text.end(); ++i) + (*i) = tolower(*i); } const std::string lowercase(const std::string &text) { std::string t; - for (std::string::const_iterator i = text.begin(); i != text.end(); ++i) - t += tolower(*i); + for (std::string::const_iterator i = text.begin(); i != text.end(); ++i) + t += tolower(*i); return t; } @@ -139,7 +139,7 @@ void trim(std::string &text) text.erase(0, 1); } while (text.size() && text[text.size()-1] == ' ') { - text.erase(text.size()-1, 1); + text.erase(text.size() - 1, 1); } } |