From 609e3348dd4105a4c1d62e9bfaf6195a7d237130 Mon Sep 17 00:00:00 2001 From: gambas Date: Mon, 20 May 2019 16:14:17 +0200 Subject: [PATCH] Stream.Eof is a new property that returns if end of stream has been reached. [INTERPRETER] * NEW: Stream.Eof is a new property that returns if end of stream has been reached. It's the same thing as Eof(Stream). --- main/gbx/gbx_c_file.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main/gbx/gbx_c_file.c b/main/gbx/gbx_c_file.c index f2176ec49..ecfcf7804 100644 --- a/main/gbx/gbx_c_file.c +++ b/main/gbx/gbx_c_file.c @@ -825,6 +825,12 @@ BEGIN_METHOD_VOID(Stream_free) END_METHOD +BEGIN_PROPERTY(Stream_Eof) + + GB_ReturnBoolean(STREAM_eof(CSTREAM_stream(THIS_STREAM))); + +END_PROPERTY + BEGIN_METHOD(Stream_ReadLine, GB_STRING escape) char *escape; @@ -1053,6 +1059,8 @@ GB_DESC StreamDesc[] = GB_METHOD("Drop", NULL, Stream_Cancel, NULL), GB_METHOD("Watch", NULL, Stream_Watch, "(Mode)i(Watch)b"), + + GB_PROPERTY_READ("Eof", "b", Stream_Eof), GB_END_DECLARE };