// $Id: unicode.h,v 1.3 1999/01/25 20:00:32 shields Exp $ copyright notice #ifndef unicode_INCLUDED #define unicode_INCLUDED #include "config.h" #include <iostream.h> #include <wchar.h> #include <ctype.h> #include "bool.h" #include "code.h" #include "case.h" class Unicode { public: static inline void Cout(wchar_t ch) { #ifdef EBCDIC cout << (char) (ch > 0 && ch < 0x00C0 ? Code::ToEBCDIC(ch) : ' '); #else cout << (char) (ch > 0 && ch < 0x00C0 ? ch : ' '); #endif } static inline void Cout(wchar_t *str) { for (; *str; str++) Cout(*str); } static inline void Cerr(wchar_t ch) { #ifdef EBCDIC cerr << (char) (ch > 0 && ch < 0x00C0 ? Code::ToEBCDIC(ch) : ' '); #else cerr << (char) (ch > 0 && ch < 0x00C0 ? ch : ' '); #endif } static inline void Cerr(wchar_t *str) { for (; *str; str++) Cerr(*str); } static inline void Cout(char ch) { #ifdef EBCDIC cout << (char) (ch > 0 && ch < 0x00C0 ? Code::ToEBCDIC(ch) : ' '); #else cout << (char) (ch > 0 && ch < 0x00C0 ? ch : ' '); #endif } static inline void Cout(char *str) { for (; *str; str++) Cout(*str); } static inline void Cerr(char ch) { #ifdef EBCDIC cerr << (char) (ch > 0 && ch < 0x00C0 ? Code::ToEBCDIC(ch) : ' '); #else cerr << (char) (ch > 0 && ch < 0x00C0 ? ch : ' '); #endif } static inline void Cerr(char *str) { for (; *str; str++) Cerr(*str); } }; #endif