From 5abab2c54b3da53cc9d64cbf0f369fc7486d194c Mon Sep 17 00:00:00 2001 From: Gert van Valkenhoef Date: Mon, 7 Nov 2011 19:09:54 +0000 Subject: [PATCH] Fold reading (partial) --- fold.cc | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ fold.h | 38 +++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 fold.cc create mode 100644 fold.h diff --git a/fold.cc b/fold.cc new file mode 100644 index 0000000..4be4081 --- /dev/null +++ b/fold.cc @@ -0,0 +1,62 @@ +#include +#include + +namespace odc { + +const std::string View::TYPENAME("Views.View^"); +const TypeProxy 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::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 index 0000000..ad56642 --- /dev/null +++ b/fold.h @@ -0,0 +1,38 @@ +#ifndef _TEXTMODEL_H_ +#define _TEXTMODEL_H_ + +#include +#include +#include + +namespace odc { + + class View : public Store { + private: + static const std::string TYPENAME; + static const TypeProxy 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 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 -- 2.29.2