DEADSOFTWARE

Almost-correct toPlainText
[odcread.git] / alien.h
1 #ifndef _ALIEN_H_
2 #define _ALIEN_H_
4 #include <oberon.h>
5 #include <store.h>
6 #include <iostream>
7 #include <vector>
8 #include <string>
10 namespace odc {
12 /**
13 * Part of an alien store
14 */
15 struct AlienComponent {
16 virtual std::string toString() = 0;
17 virtual std::string toPlainText() = 0;
18 };
20 /**
21 * Totally unstructured part of an alien store
22 */
23 struct AlienPiece : public AlienComponent {
24 const char * const data;
25 const size_t len;
27 AlienPiece(const char * const data, const size_t len);
29 virtual std::string toString();
30 virtual std::string toPlainText();
31 };
33 /**
34 * Store component of an alien store
35 */
36 struct AlienPart : public AlienComponent {
37 Store * const d_store;
39 AlienPart(Store * const store);
41 virtual std::string toString();
42 virtual std::string toPlainText();
43 };
45 class Alien : public Store {
46 const TypePath d_path;
47 std::vector<AlienComponent*> d_comps;
49 public:
51 Alien(INTEGER id, const TypePath &path);
53 std::vector<AlienComponent*> & getComponents();
55 // cause-: INTEGER; (** # 0, the cause that turned this store into an alien **)
56 // file-: Files.File; (** base file holding alien pieces **)
57 // comps-: AlienComp (** the constituent components of this alien store **)
59 virtual std::string toString();
60 virtual std::string toPlainText();
61 };
63 }
64 #endif // _ALIEN_H_