DEADSOFTWARE

Testing odcread against a bunch of existing .odc files
[odcread.git] / alien.h
diff --git a/alien.h b/alien.h
index 40ef09ab838b9c21b5860549acfddedd9e680b3a..77db1febc2239e3d12886ff7ee8e44e2a8edc90f 100644 (file)
--- a/alien.h
+++ b/alien.h
@@ -3,8 +3,10 @@
 
 #include <oberon.h>
 #include <store.h>
+#include <visitor.h>
 #include <iostream>
 #include <vector>
+#include <string>
 
 namespace odc {
 
@@ -13,6 +15,7 @@ namespace odc {
  */
 struct AlienComponent {
        virtual std::string toString() = 0;
+       virtual void accept(Visitor &visitor) const = 0;
 };
 
 /**
@@ -25,26 +28,33 @@ struct AlienPiece : public AlienComponent {
        AlienPiece(const char * const data, const size_t len);
 
        virtual std::string toString();
+       virtual void accept(Visitor &visitor) const;
 };
 
 /**
  * Store component of an alien store
  */
 struct AlienPart : public AlienComponent {
-       Store * const store;
+       Store * const d_store;
 
-       AlienPart(Store * const _store);
+       AlienPart(Store * const store);
 
        virtual std::string toString();
+       virtual void accept(Visitor &visitor) const;
 };
 
+/**
+ * Any type that's not registered is treated as an "Alien".
+ * This allows us to read files even if they contain things we're not aware of.
+ * The alien will consist of AlienComponents, some of which we may be able to read.
+ */
 class Alien : public Store {
-       SHORTCHAR **d_path;
+       const TypePath d_path;
        std::vector<AlienComponent*> d_comps;
 
        public:
 
-       Alien(INTEGER id, SHORTCHAR **path);
+       Alien(INTEGER id, const TypePath &path);
 
        std::vector<AlienComponent*> & getComponents();
 
@@ -53,6 +63,7 @@ class Alien : public Store {
        // comps-: AlienComp    (** the constituent components of this alien store **)
 
        virtual std::string toString();
+       virtual void accept(Visitor &visitor) const;
 };
 
 }