From 5ceb4694a05ec68b5cfba18b0f25ba804be88a80 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 12 May 2008 18:32:15 +0000 Subject: console colors --- src/auxiliary/functions.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/auxiliary') diff --git a/src/auxiliary/functions.h b/src/auxiliary/functions.h index 88af5c7..eff5143 100644 --- a/src/auxiliary/functions.h +++ b/src/auxiliary/functions.h @@ -23,6 +23,12 @@ inline const std::string plural(const std::string & word, size_t n) { return plu const std::string article(const char * word); inline const std::string article(const std::string & word) { return article(word.c_str()); } + +inline bool is_base_color_code(char const *c) { return ((*c == '^') && (*(c+1) >= '0') && (*(c+1) <= '9')); } + +inline bool is_core_color_code(char const *c) { return ((*c == '^') && (*(c+1) >= 'A') && (*(c+1) <= 'Z')); } + +inline bool is_color_code(char const *c) { return (is_base_color_code(c) || is_core_color_code(c)); } } #endif // __INCLUDED_AUX_FUNCTIONS_H__ -- cgit v1.2.3