comparison src/oct-stream.h @ 2148:ee08cc210438

[project @ 1996-05-13 06:42:10 by jwe]
author jwe
date Mon, 13 May 1996 06:43:06 +0000
parents b240b2fce8ed
children ab0e1fd337f5
comparison
equal deleted inserted replaced
2147:678cb6a93368 2148:ee08cc210438
360 class 360 class
361 octave_stream 361 octave_stream
362 { 362 {
363 public: 363 public:
364 364
365 octave_stream (octave_base_stream *bs = 0) : rep (bs) { } 365 octave_stream (octave_base_stream *bs = 0, bool pf = false)
366 366 : rep (bs), preserve (pf) { }
367 ~octave_stream (void) { delete rep; } 367
368 ~octave_stream (void)
369 {
370 if (! preserve)
371 delete rep;
372 }
368 373
369 int flush (void); 374 int flush (void);
370 375
371 string getl (int max_len, bool& err); 376 string getl (int max_len, bool& err);
372 string getl (const octave_value& max_len, bool& err); 377 string getl (const octave_value& max_len, bool& err);
426 431
427 private: 432 private:
428 433
429 // The actual representation of this stream. 434 // The actual representation of this stream.
430 octave_base_stream *rep; 435 octave_base_stream *rep;
436
437 // If true, don't delete rep.
438 bool preserve;
431 439
432 void invalid_stream_error (const char *op) const; 440 void invalid_stream_error (const char *op) const;
433 441
434 bool stream_ok (const char *op, bool clear = true) const 442 bool stream_ok (const char *op, bool clear = true) const
435 { 443 {