DEADSOFTWARE

Completely convert .odc to .txt using Visitor
[odcread.git] / alien.h
1 #ifndef _ALIEN_H_
2 #define _ALIEN_H_
4 #include <oberon.h>
5 #include <store.h>
6 #include <visitor.h>
7 #include <iostream>
8 #include <vector>
9 #include <string>
11 namespace odc {
13 /**
14 * Part of an alien store
15 */
16 struct AlienComponent {
17 virtual std::string toString() = 0;
18 virtual void accept(Visitor &visitor) const = 0;
19 };
21 /**
22 * Totally unstructured part of an alien store
23 */
24 struct AlienPiece : public AlienComponent {
25 const char * const data;
26 const size_t len;
28 AlienPiece(const char * const data, const size_t len);
30 virtual std::string toString();
31 virtual void accept(Visitor &visitor) const;
32 };
34 /**
35 * Store component of an alien store
36 */
37 struct AlienPart : public AlienComponent {
38 Store * const d_store;
40 AlienPart(Store * const store);
42 virtual std::string toString();
43 virtual void accept(Visitor &visitor) const;
44 };
46 class Alien : public Store {
47 const TypePath d_path;
48 std::vector<AlienComponent*> d_comps;
50 public:
52 Alien(INTEGER id, const TypePath &path);
54 std::vector<AlienComponent*> & getComponents();
56 // cause-: INTEGER; (** # 0, the cause that turned this store into an alien **)
57 // file-: Files.File; (** base file holding alien pieces **)
58 // comps-: AlienComp (** the constituent components of this alien store **)
60 virtual std::string toString();
61 virtual void accept(Visitor &visitor) const;
62 };
64 }
65 #endif // _ALIEN_H_