Nebula
Loading...
Searching...
No Matches
streamwriter.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
14#include "core/refcounted.h"
15#include "core/ptr.h"
16#include "io/stream.h"
17
18//------------------------------------------------------------------------------
19namespace IO
20{
22{
24public:
28 virtual ~StreamWriter();
30 void SetStream(const Ptr<Stream>& s);
32 const Ptr<Stream>& GetStream() const;
34 bool HasStream() const;
36 virtual bool Open();
38 virtual void Close();
40 bool IsOpen() const;
41
42protected:
44 bool isOpen;
46};
47
48//------------------------------------------------------------------------------
51inline
52bool
54{
55 return this->isOpen;
56}
57
58} // namespace IO
59//------------------------------------------------------------------------------
The common base class of Nebula.
Definition refcounted.h:38
Stream writer classes provide a specialized write-interface for a stream.
Definition streamwriter.h:22
bool streamWasOpen
Definition streamwriter.h:45
const Ptr< Stream > & GetStream() const
get currently set stream
Definition streamwriter.cc:49
bool IsOpen() const
return true if currently open
Definition streamwriter.h:53
__DeclareClass(StreamWriter)
virtual ~StreamWriter()
destructor
Definition streamwriter.cc:26
StreamWriter()
constructor
Definition streamwriter.cc:16
bool isOpen
Definition streamwriter.h:44
virtual void Close()
end reading from the stream
Definition streamwriter.cc:92
virtual bool Open()
begin reading from the stream
Definition streamwriter.cc:68
Ptr< Stream > stream
Definition streamwriter.h:43
bool HasStream() const
return true if a stream is set
Definition streamwriter.cc:59
void SetStream(const Ptr< Stream > &s)
set stream to write to
Definition streamwriter.cc:37
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