home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / LASER / DJPRNT.ZIP / LINE.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1990-02-10  |  616 b   |  34 lines

  1. /*
  2.     LINE.HPP
  3.     Copyright (c) Les Hancock 1990
  4. */
  5.  
  6. #ifndef LINE_HPP
  7. #define LINE_HPP
  8.  
  9. enum yesno { yes, no };
  10.  
  11. struct char_buf
  12. {
  13.     unsigned int size;
  14.     char *head;
  15.     char_buf(unsigned int n) { head = new char [size = n]; }
  16.     ~char_buf() { delete head; }
  17. };
  18.  
  19. class line : char_buf
  20. {
  21.     unsigned int eof : 1;
  22.     unsigned int tab_size : 5;
  23. public:
  24.     line(unsigned int line_len, unsigned int t) : (line_len) 
  25.     {
  26.         tab_size = t;
  27.         eof = 0;    // eof 1 means we hit end of the input stream
  28.     }
  29.     friend istream& operator>>(istream& in, line& a_line);
  30.     yesno is_eof() { return eof ? yes : no; }
  31. };
  32.  
  33. #endif
  34.