00001 // 00002 // aegis - project change supervisor 00003 // Copyright (C) 2004-2008 Peter Miller 00004 // 00005 // This program is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation; either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program. If not, see 00017 // <http://www.gnu.org/licenses/>. 00018 // 00019 00020 #ifndef LIBAEGIS_SUB_DIVERSION_STACK_H 00021 #define LIBAEGIS_SUB_DIVERSION_STACK_H 00022 00023 #include <common/ac/stddef.h> 00024 #include <libaegis/sub/diversion.h> 00025 00030 class sub_diversion_stack 00031 { 00032 public: 00036 virtual ~sub_diversion_stack(); 00037 00041 sub_diversion_stack(); 00042 00052 void push_back(const wstring &s, bool resub); 00053 00058 void pop_back(); 00059 00065 bool resub_both() const; 00066 00071 wchar_t getch(); 00072 00077 void ungetch(wchar_t c); 00078 00083 bool empty() const { return (top == 0); } 00084 00085 private: 00090 size_t top; 00091 00096 size_t max; 00097 00103 sub_diversion *stack; 00104 00108 sub_diversion_stack(const sub_diversion_stack &); 00109 00113 sub_diversion_stack &operator=(const sub_diversion_stack &); 00114 }; 00115 00116 #endif // LIBAEGIS_SUB_DIVERSION_STACK_H