X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=reader.cc;h=a57e9bebefc50265d0b11cc48160d5c85e9cb3c8;hb=41d9c65ec79728a8771cd2288dfc3458569c6801;hp=21cef1dd1882ec8fcdda0033f05821e6f67a538c;hpb=519462238ad20b1aca242075e3fe8c0d0719b3d4;p=odcread.git diff --git a/reader.cc b/reader.cc index 21cef1d..a57e9be 100644 --- a/reader.cc +++ b/reader.cc @@ -133,6 +133,7 @@ Store* Reader::readStore() { // len, pos, pos1, id, comment, next, down, downPos, nextTypeId, nextElemId, nextStoreId: INTEGER; // kind: SHORTCHAR; path: TypePath; type: TypeName; // save: ReaderState; + Store *Reader::readNilStore() { INTEGER comment = readInt(); std::streamoff next = readInt(); @@ -149,16 +150,18 @@ Store *Reader::readNilStore() { // rd.st.end := rd.Pos(); // IF (next > 0) OR ((next = 0) & ODD(comment)) THEN rd.st.next := rd.st.end + next ELSE rd.st.next := 0 END; // x := NIL + Store *Reader::readLinkStore() { - return 0; + throw "Reader::readLinkStore() not implemented"; } // ELSIF kind = link THEN // rd.ReadInt(id); rd.ReadInt(comment); rd.ReadInt(next); // rd.st.end := rd.Pos(); // IF (next > 0) OR ((next = 0) & ODD(comment)) THEN rd.st.next := rd.st.end + next ELSE rd.st.next := 0 END; // x := ThisStore(rd.eDict, id) + Store *Reader::readNewLinkStore() { - return 0; + throw "Reader::readNewLinkStore() not implemented"; } // ELSIF kind = newlink THEN // rd.ReadInt(id); rd.ReadInt(comment); rd.ReadInt(next); @@ -232,7 +235,6 @@ Store *Reader::readStoreOrElemStore(bool isElem) { d_store = x; } else { // join(d_store, x) - //std::cout << "Man, should have written join(.,.)" << std::endl; } if (isElem) { d_elemList.push_back(x); @@ -247,7 +249,6 @@ Store *Reader::readStoreOrElemStore(bool isElem) { d_store = alien; } else { // join(d_store, alien) - //std::cout << "Man, should have written join(.,.)" << std::endl; } if (isElem) { d_elemList.push_back(alien); @@ -276,14 +277,12 @@ void Reader::internalizeAlien(Alien *alien, std::streampos down, std::streampos std::streampos next = down != 0 ? down : end; while (d_rider.tellg() < end) { if (d_rider.tellg() < next) { // for some reason, this means its a piece (unstructured) - //std::cout << "Alien Piece" << std::endl; size_t len = next - d_rider.tellg(); char *buf = new char[len]; d_rider.read(buf, len); AlienComponent *comp = new AlienPiece(buf, len); alien->getComponents().push_back(comp); } else { // that means we've got a store - //std::cout << "Alien Store" << std::endl; d_rider.seekg(next); AlienComponent *comp = new AlienPart(readStore()); alien->getComponents().push_back(comp);