DEADSOFTWARE

Read NIL stores correctly
[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 };
19 /**
20 * Totally unstructured part of an alien store
21 */
22 struct AlienPiece : public AlienComponent {
23 const char * const data;
24 const size_t len;
26 AlienPiece(const char * const data, const size_t len);
28 virtual std::string toString();
29 };
31 /**
32 * Store component of an alien store
33 */
34 struct AlienPart : public AlienComponent {
35 Store * const store;
37 AlienPart(Store * const _store);
39 virtual std::string toString();
40 };
42 class Alien : public Store {
43 const TypePath d_path;
44 std::vector<AlienComponent*> d_comps;
46 public:
48 Alien(INTEGER id, const TypePath &path);
50 std::vector<AlienComponent*> & getComponents();
52 // cause-: INTEGER; (** # 0, the cause that turned this store into an alien **)
53 // file-: Files.File; (** base file holding alien pieces **)
54 // comps-: AlienComp (** the constituent components of this alien store **)
56 virtual std::string toString();
57 };
59 }
60 #endif // _ALIEN_H_