home *** CD-ROM | disk | FTP | other *** search
- /*
- LINE.HPP
- Copyright (c) Les Hancock 1990
- */
-
- #ifndef LINE_HPP
- #define LINE_HPP
-
- enum yesno { yes, no };
-
- struct char_buf
- {
- unsigned int size;
- char *head;
- char_buf(unsigned int n) { head = new char [size = n]; }
- ~char_buf() { delete head; }
- };
-
- class line : char_buf
- {
- unsigned int eof : 1;
- unsigned int tab_size : 5;
- public:
- line(unsigned int line_len, unsigned int t) : (line_len)
- {
- tab_size = t;
- eof = 0; // eof 1 means we hit end of the input stream
- }
- friend istream& operator>>(istream& in, line& a_line);
- yesno is_eof() { return eof ? yes : no; }
- };
-
- #endif
-