Nebula
Loading...
Searching...
No Matches
streamreader.h
Go to the documentation of this file.
1#pragma once
2#ifndef IO_STREAMREADER_H
3#define IO_STREAMREADER_H
4//------------------------------------------------------------------------------
16#include "core/refcounted.h"
17#include "core/ptr.h"
18#include "io/stream.h"
19
20//------------------------------------------------------------------------------
21namespace IO
22{
24{
26public:
30 virtual ~StreamReader();
32 void SetStream(const Ptr<Stream>& s);
34 const Ptr<Stream>& GetStream() const;
36 bool HasStream() const;
38 bool Eof() const;
40 virtual bool Open();
42 virtual void Close();
44 bool IsOpen() const;
45protected:
47 bool isOpen;
49};
50
51//------------------------------------------------------------------------------
54inline
55bool
57{
58 return this->isOpen;
59}
60
61} // namespace IO
62//------------------------------------------------------------------------------
63#endif
The common base class of Nebula.
Definition refcounted.h:38
Stream reader classes provide a specialized read-interface for a stream.
Definition streamreader.h:24
bool IsOpen() const
return true if currently open
Definition streamreader.h:56
virtual bool Open()
begin reading from the stream
Definition streamreader.cc:78
Ptr< Stream > stream
Definition streamreader.h:46
virtual ~StreamReader()
destructor
Definition streamreader.cc:26
__DeclareClass(StreamReader)
bool isOpen
Definition streamreader.h:47
const Ptr< Stream > & GetStream() const
get currently set stream
Definition streamreader.cc:49
StreamReader()
constructor
Definition streamreader.cc:16
bool streamWasOpen
Definition streamreader.h:48
bool Eof() const
return true if the stream has reached EOF
Definition streamreader.cc:68
void SetStream(const Ptr< Stream > &s)
set stream to read from
Definition streamreader.cc:37
bool HasStream() const
return true if a stream is set
Definition streamreader.cc:59
virtual void Close()
end reading from the stream
Definition streamreader.cc:102
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Instances of wrapped stream classes.
Definition orientation.cc:10