/* @(#)support.h (c) Telelogic AB */ #ifndef _SUPPORT_HPP_ #define _SUPPORT_HPP_ #include #include #ifndef NULL #define NULL 0 #endif #define EXIT_OK 0 #include typedef enum { BOOL_TRUE = 0, BOOL_FALSE = 1 } BoolEnum; // Text Class typedef class Text *TextObj; class Text { private: char* Str; int Len; public: Text(); Text(char* str); ~Text(); void operator=(char* string); char* GetStr(); void SetStr(const char *); }; std::istream& operator>>(std::istream& f, Text& text); std::ostream& operator<<(std::ostream& f, Text& text); typedef enum { LANG_ENGLISH = 0, LANG_FRENCH = 1, LANG_UNKNOWN = 2 } LangEnum; std::istream& operator>>(std::istream& f, LangEnum& lang); class PolyText { private: Text French; Text English; static LangEnum Language; public: PolyText(); ~PolyText(); void SetStr(LangEnum lang, const char* str); Text& GetText(LangEnum lang); void SetLang(LangEnum); LangEnum GetLang(); }; std::ostream& operator<<(std::ostream& f, PolyText& polytext); inline void comment(const char* streng, const char* strfr) { PolyText ptext; ptext.SetStr(LANG_FRENCH, strfr); ptext.SetStr(LANG_ENGLISH, streng); std::cout<>tmp; } // Filter an input according a type and a domain void Filter(std::istream& f, int& value, int min, int max); void Filter(std::istream& f, int& value); #define POSITIVE(x) (x > 0) #endif