Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-05-12 18:32:15 +0000
committerStijn Buys <ingar@osirion.org>2008-05-12 18:32:15 +0000
commit5ceb4694a05ec68b5cfba18b0f25ba804be88a80 (patch)
treed1baddc086de4bb4fa04cf59d11516f4ecc89bf3 /src/auxiliary
parente4f2faa8d5895ba30207c09c7886afb21a697d5f (diff)
console colors
Diffstat (limited to 'src/auxiliary')
-rw-r--r--src/auxiliary/functions.h6
1 files changed, 6 insertions, 0 deletions
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__