add is_valid

This commit is contained in:
David Rose 2004-03-19 01:48:50 +00:00
parent 2e85d47cd2
commit c1583ac567
2 changed files with 16 additions and 1 deletions

View File

@ -26,7 +26,8 @@ INLINE PNMWriter::
PNMWriter(PNMFileType *type, ostream *file, bool owns_file) :
_type(type),
_owns_file(owns_file),
_file(file)
_file(file),
_is_valid(true)
{
}
@ -106,3 +107,14 @@ INLINE void PNMWriter::
copy_header_from(const PNMImageHeader &header) {
PNMImageHeader::operator = (header);
}
////////////////////////////////////////////////////////////////////
// Function: PNMWriter::is_valid
// Access: Public
// Description: Returns true if the PNMWriter can be used to write
// data, false if something is wrong.
////////////////////////////////////////////////////////////////////
INLINE bool PNMWriter::
is_valid() const {
return _is_valid;
}

View File

@ -59,10 +59,13 @@ public:
virtual bool supports_stream_write() const;
INLINE bool is_valid() const;
protected:
PNMFileType *_type;
bool _owns_file;
ostream *_file;
bool _is_valid;
};
#include "pnmWriter.I"