Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Reader.h
Go to the documentation of this file.
1 /* Project nGen
2  John DiCamillo Software Consulting
3  Copyright © 1997-2000. All Rights Reserved.
4 
5  SUBSYSTEM: obelisk
6  FILE: reader.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Declaration of the Reader class
13 */
14 
15 #ifndef READER_H
16 #define READER_H
17 
18 #include "text.h"
19 
20 // +-------------------------------------------------------------------+
21 
22 class Reader
23 {
24 public:
25  Reader() { }
26  virtual ~Reader() { }
27 
28  virtual Text more() = 0;
29 };
30 
31 class ConsoleReader : public Reader
32 {
33 public:
34  virtual Text more();
35 
36  void printPrimaryPrompt();
37  void fillInputBuffer();
38 
39 private:
40  char buffer[1000];
41  char* p;
42 };
43 
44 class FileReader : public Reader
45 {
46 public:
47  FileReader(const char* fname);
48  virtual Text more();
49 
50 private:
51  Text filename;
52  int done;
53 };
54 
55 class BlockReader : public Reader
56 {
57 public:
58  BlockReader(const char* block);
59  BlockReader(const char* block, int len);
60  virtual Text more();
61 
62 private:
63  char* data;
64  int done;
65  int length;
66 };
67 
68 #endif