00001 #ifndef MENU_RESPONSE_CLASS_HEADER_INCLUDED 00002 #define MENU_RESPONSE_CLASS_HEADER_INCLUDED 00003 00004 #define TEMPLATE_CLASSES_WONT_COMPILE 00005 #include "array.h" 00006 00007 class MenuChoice { 00008 char *number; 00009 char *letters; 00010 00011 public: 00012 MenuChoice(); 00013 MenuChoice(const char n[], const char l[]); 00014 MenuChoice(const MenuChoice & choice); 00015 ~MenuChoice(); 00016 00017 MenuChoice & operator = (const MenuChoice & choice); 00018 00019 bool operator == (const MenuChoice & choice) const; 00020 bool operator == (const char choice[]) const; 00021 bool operator == (const char choice) const; 00022 }; 00023 00024 class MenuResponse { 00025 char *menu; 00026 Array<MenuChoice> valid_choices; 00027 00028 void update_choices(void); 00029 00030 public: 00031 MenuResponse(const char menu_text[]); 00032 MenuResponse(const char * menu_text[], long items = 0); 00033 MenuResponse(const MenuResponse & menu); 00034 ~MenuResponse(); 00035 00036 MenuResponse & operator = (const MenuResponse & menu); 00037 00038 long get_response(void) const; 00039 }; 00040 00041 #endif