From f71901eeab126bb4b7e2552dd2edf0b34632c683 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 26 May 2008 16:34:39 +0000 Subject: radar, aux text functions, restore original frustum, documentation update --- src/auxiliary/functions.cc | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/auxiliary/functions.cc') diff --git a/src/auxiliary/functions.cc b/src/auxiliary/functions.cc index b417a4a..e9861ac 100644 --- a/src/auxiliary/functions.cc +++ b/src/auxiliary/functions.cc @@ -64,6 +64,38 @@ size_t text_length(const std::string &text) return len; } +const std::string text_strip(const std::string &text) +{ + const char *c = text.c_str(); + std::string r; + while (*c) { + if (is_color_code(c)) { + c++; + } else { + r += *c; + } + c++; + } + + return r; +} + +const std::string text_strip_lowercase(const std::string &text) +{ + const char *c = text.c_str(); + std::string r; + while (*c) { + if (is_color_code(c)) { + c++; + } else { + r += tolower(*c); + } + c++; + } + + return r; +} + const std::string spaces(const std::string &text,size_t n) { size_t l = text_length(text); -- cgit v1.2.3