Files
harbour-core/harbour/samples/cccppc/reader.cls
1999-11-09 01:37:27 +00:00

70 lines
2.2 KiB
OpenEdge ABL
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//
// $Id$
//
//*******************************************************************
// reader.cls: Źltal nos stream olvas˘ oszt ly. Ebb“l ”r”k”lnek a
// karakter s a token olvas˘ oszt lyok.
// 1999, Csisz r Levente
class READER OBJECT
attrib name // Az olvasott stream azonosˇt˘ja (a
// hibajelzsekhez)
attrib errorStream // Ebbe a t”mbbe ˇrja a hiba<62>zeneteket.
// prsError objektumok vannak benne.
attrib tbuffer // Ez egy TBUFFER, ide teszi be az unread()-el
// visszatett itemeket.
nmethod read()
// Olvas egy 'elemet'. Az elem a nil kivtelvel b rmilyen
// objektum lehet. Ha az unget puffer nem <20>res, akkor onnan
// olvassa, ha <20>res, akkor pedig a readItem()-el olvas egyet
// a stream-b“l.
// Ret: Az elem, ha OK, nil, ha vge van a streamnek, vagy ha
// hiba volt. Hiba esetn be llˇtja a this:error-t.
nmethod unread(item)
// Visszatesz az readerbe egy elemet.
nmethod readTBuffer()
// A tbuffer-b“l olvas. Ha a tbuffer <20>res, akkor nil
nmethod arrayTBuffer()
// Ad egy t”mb”t, amiben a tbuffer elemi vannak.
abstract nmethod readItem()
// Bels“ mvelet, az val˘di aloszt lyoknak implement lni kell.
// Olvas egy 'elemet' k”zvetlen<65>l a stream-b“l az unget puffer
// megker<65>lsvel. Az elem a nil kivtelvel b rmilyen
// objektum lehet.
// Ret: Az elem, ha OK, nil, ha vge van a streamnek, vagy ha
// hiba volt. Hiba esetn be llˇtja a this:error-t.
nmethod isError(l)
// Igaz, ha volt hiba.
// l: Az errorStream el“z“ hossza. Ha meg van adva, akkor akkor
// ad igazat, ha az errorStream hossza nagyobb, mint az l.
nmethod addError(prsErr)
// Hozz ad egy prsErr objektumot az errorStream-hez, ha az nem nil
// nmethod errorStr()
// Nil, ha nem volt hiba, egy string, ami a hiba leˇr s t
// tartalmazza, ha volt hiba.
abstract nmethod destruct{retnil}()
// T”rli az objektumhoz kapcsol˘d˘ k<>ls“ eszk”z”ket. (Pl. lez rja
// a filt etc.)
rmethod oinit(name,errorStream)
// Inicializ lja az objektumot.
metaclass
rmethod onew(name,errorStream)