diff options
author | Andrzej Rybczak <electricityispower@gmail.com> | 2009-09-15 16:36:26 +0000 |
---|---|---|
committer | Andrzej Rybczak <electricityispower@gmail.com> | 2009-09-15 16:36:26 +0000 |
commit | 27687fd2b12914e9960aa78a1d12d620ac049cf7 (patch) | |
tree | 33a4f381733caf53f833dc6447965e6e31db6f70 /src/helpers.h | |
parent | 40b9b547ddb50a3eb29935bb3aadbc4ea91dafe7 (diff) |
pass Buffer/Window to ShowTag() by reference
returning new Buffer and passing it to Window by operator<<()
was rather bad idea since it required unnecessary copying.
Diffstat (limited to 'src/helpers.h')
-rw-r--r-- | src/helpers.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/helpers.h b/src/helpers.h index 9f388e9f..0f8a0c21 100644 --- a/src/helpers.h +++ b/src/helpers.h @@ -95,6 +95,14 @@ template <typename C> void String2Buffer(const std::basic_string<C> &s, basic_bu } } +template <typename T> void ShowTag(T &buf, const std::string &tag) +{ + if (tag.empty()) + buf << Config.empty_tags_color << Config.empty_tag << clEnd; + else + buf << tag; +} + inline bool Keypressed(int in, const int *key) { return in == key[0] || in == key[1]; @@ -113,8 +121,6 @@ std::string GetLineValue(std::string &, char = '"', char = '"', bool = 0); void RemoveTheWord(std::string &s); std::string ExtractTopDirectory(const std::string &); -Buffer ShowTag(const std::string &); - #ifdef _UTF8 std::basic_string<my_char_t> Scroller(const std::string &str, size_t &pos, size_t width); #endif // _UTF8 |