added wxFileStream::IsOk() (patch 1749587)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47267 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2007-07-09 16:59:09 +00:00
parent 0a904ed2c8
commit a6ac8d7582
2 changed files with 18 additions and 12 deletions

View File

@ -116,6 +116,7 @@ class WXDLLIMPEXP_BASE wxFileStream : public wxFileInputStream,
{ {
public: public:
wxFileStream(const wxString& fileName); wxFileStream(const wxString& fileName);
virtual bool IsOk() const;
private: private:
DECLARE_NO_COPY_CLASS(wxFileStream) DECLARE_NO_COPY_CLASS(wxFileStream)

View File

@ -107,9 +107,9 @@ wxFileOffset wxFileInputStream::OnSysTell() const
return m_file->Tell(); return m_file->Tell();
} }
bool wxFileInputStream::IsOk() const bool wxFileInputStream::IsOk() const
{ {
return (wxStreamBase::IsOk() && m_file->IsOpened()); return wxStreamBase::IsOk() && m_file->IsOpened();
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -183,9 +183,9 @@ wxFileOffset wxFileOutputStream::GetLength() const
return m_file->Length(); return m_file->Length();
} }
bool wxFileOutputStream::IsOk() const bool wxFileOutputStream::IsOk() const
{ {
return (wxStreamBase::IsOk() && m_file->IsOpened()); return wxStreamBase::IsOk() && m_file->IsOpened();
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -225,6 +225,11 @@ wxFileStream::wxFileStream(const wxString& fileName)
wxFileOutputStream::m_file = wxFileInputStream::m_file; wxFileOutputStream::m_file = wxFileInputStream::m_file;
} }
bool wxFileStream::IsOk() const
{
return wxStreamBase::IsOk() && wxFileInputStream::m_file->IsOpened();
}
#endif //wxUSE_FILE #endif //wxUSE_FILE
#if wxUSE_FFILE #if wxUSE_FFILE
@ -300,9 +305,9 @@ wxFileOffset wxFFileInputStream::OnSysTell() const
return m_file->Tell(); return m_file->Tell();
} }
bool wxFFileInputStream::IsOk() const bool wxFFileInputStream::IsOk() const
{ {
return (wxStreamBase::IsOk() && m_file->IsOpened()); return wxStreamBase::IsOk() && m_file->IsOpened();
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -386,9 +391,9 @@ wxFileOffset wxFFileOutputStream::GetLength() const
return m_file->Length(); return m_file->Length();
} }
bool wxFFileOutputStream::IsOk() const bool wxFFileOutputStream::IsOk() const
{ {
return (wxStreamBase::IsOk() && m_file->IsOpened()); return wxStreamBase::IsOk() && m_file->IsOpened();
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------