DEADSOFTWARE

Fold reading (partial)
authorGert van Valkenhoef <g.h.m.van.valkenhoef@rug.nl>
Mon, 7 Nov 2011 19:09:54 +0000 (19:09 +0000)
committerGert van Valkenhoef <g.h.m.van.valkenhoef@rug.nl>
Mon, 7 Nov 2011 19:09:54 +0000 (19:09 +0000)
fold.cc [new file with mode: 0644]
fold.h [new file with mode: 0644]

diff --git a/fold.cc b/fold.cc
new file mode 100644 (file)
index 0000000..4be4081
--- /dev/null
+++ b/fold.cc
@@ -0,0 +1,62 @@
+#include <fold.h>
+#include <reader.h>
+
+namespace odc {
+
+const std::string View::TYPENAME("Views.View^");
+const TypeProxy<View> View::PROXY;
+
+View::View(INTEGER id) : Store(id) {}
+
+const std::string &View::getType() {
+       return TYPENAME;
+}
+
+const std::string *View::getSuper() {
+       return &Store::getType();
+}
+
+const std::string &View::getTypeName() const {
+       return getType();
+}
+
+void View::internalize(Reader &reader) {
+       Store::internalize(reader);
+       if (reader.isCancelled()) return;
+       reader.readVersion(0, 0);
+}
+
+const std::string Fold::TYPENAME("Folds.Fold^");
+const TypeProxy<Fold> Fold::PROXY;
+
+Fold::Fold(INTEGER id) : View(id) {}
+
+const std::string &Fold::getType() {
+       return TYPENAME;
+}
+
+const std::string *Fold::getSuper() {
+       return &View::getType();
+}
+
+const std::string &Fold::getTypeName() const {
+       return getType();
+}
+
+void Fold::internalize(Reader &reader) {
+       Store::internalize(reader);
+       if (reader.isCancelled()) return;
+       reader.readVersion(0, 0);
+       if (reader.isCancelled()) return;
+       reader.readSInt(); // FIXME IMPLEMENT
+//             rd.ReadXInt(xint);fold.leftSide := xint = 0;
+//             rd.ReadXInt(xint); fold.collapsed := xint = 0;
+//             rd.ReadXString(fold.label);
+//             rd.ReadStore(store);
+//             IF store # NIL THEN fold.hidden := store(TextModels.Model); Stores.Join(fold.hidden, fold)
+//             ELSE fold.hidden := NIL
+//             END;
+//             fold.leftSide := store # NIL
+}
+
+} // namespace odc
diff --git a/fold.h b/fold.h
new file mode 100644 (file)
index 0000000..ad56642
--- /dev/null
+++ b/fold.h
@@ -0,0 +1,38 @@
+#ifndef _TEXTMODEL_H_
+#define _TEXTMODEL_H_
+
+#include <oberon.h>
+#include <typeregister.h>
+#include <store.h>
+
+namespace odc {
+
+       class View : public Store {
+               private:
+               static const std::string TYPENAME;
+               static const TypeProxy<View> PROXY;
+
+               public:
+               View(INTEGER id);
+               static const std::string &getType();
+               static const std::string *getSuper();
+               virtual const std::string &getTypeName() const;
+               virtual void internalize(Reader &reader);
+       };
+
+       class Fold : public View {
+               private:
+               static const std::string TYPENAME;
+               static const TypeProxy<Fold> PROXY;
+
+               public:
+               Fold(INTEGER id);
+               static const std::string &getType();
+               static const std::string *getSuper();
+               virtual const std::string &getTypeName() const;
+               virtual void internalize(Reader &reader);
+       };
+
+}
+
+#endif