]> git.saurik.com Git - wxWidgets.git/commitdiff
Made wxStreamBase::IsOk() virtual;
authorRobert Roebling <robert@roebling.de>
Thu, 19 Oct 2006 12:30:59 +0000 (12:30 +0000)
committerRobert Roebling <robert@roebling.de>
Thu, 19 Oct 2006 12:30:59 +0000 (12:30 +0000)
  Overrride in file streams to test foe base class and
    for correctly opened files.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42114 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/strmbase.tex
include/wx/stream.h
include/wx/wfstream.h

index dc7a184b5112e3622cb374dffb1020ad67cca9d2..adf12c791126090ca179cf4d0bf6a71daac572e4 100644 (file)
@@ -85,7 +85,7 @@ In that cases, GetSize returns $0$ so you should always test its return value.
 
 \membersection{wxStreamBase::IsOk}\label{wxstreambaseisok}
 
 
 \membersection{wxStreamBase::IsOk}\label{wxstreambaseisok}
 
-\constfunc{bool}{IsOk}{\void}
+\constfunc{virtual bool}{IsOk}{\void}
 
 Returns true if no error occurred on the stream.
 
 
 Returns true if no error occurred on the stream.
 
index c26638a68b792b0ce376483592496af17981f34b..652c40481f17a5080742209af9c68e09d5947d03 100644 (file)
@@ -58,7 +58,7 @@ public:
 
     // error testing
     wxStreamError GetLastError() const { return m_lasterror; }
 
     // error testing
     wxStreamError GetLastError() const { return m_lasterror; }
-    bool IsOk() const { return GetLastError() == wxSTREAM_NO_ERROR; }
+    virtual bool IsOk() const { return GetLastError() == wxSTREAM_NO_ERROR; }
     bool operator!() const { return !IsOk(); }
 
     // reset the stream state
     bool operator!() const { return !IsOk(); }
 
     // reset the stream state
index 79feb44fe4e09e4c1cae8d00bf6c380f39454fe5..63c90a0961feb33cd0e1d774bdecd360cf28c817 100644 (file)
@@ -39,7 +39,7 @@ public:
     wxFileOffset GetLength() const;
 
     bool Ok() const { return IsOk(); }
     wxFileOffset GetLength() const;
 
     bool Ok() const { return IsOk(); }
-    bool IsOk() const { return m_file->IsOpened(); }
+    virtual bool IsOk() const { return (wxStreamBase::IsOk() && m_file->IsOpened()); }
     bool IsSeekable() const { return m_file->GetKind() == wxFILE_KIND_DISK; }
 
 protected:
     bool IsSeekable() const { return m_file->GetKind() == wxFILE_KIND_DISK; }
 
 protected:
@@ -69,7 +69,7 @@ public:
     wxFileOffset GetLength() const;
 
     bool Ok() const { return IsOk(); }
     wxFileOffset GetLength() const;
 
     bool Ok() const { return IsOk(); }
-    bool IsOk() const { return m_file->IsOpened(); }
+    virtual bool IsOk() const { return (wxStreamBase::IsOk() && m_file->IsOpened()); }
     bool IsSeekable() const { return m_file->GetKind() == wxFILE_KIND_DISK; }
 
 protected:
     bool IsSeekable() const { return m_file->GetKind() == wxFILE_KIND_DISK; }
 
 protected:
@@ -140,7 +140,7 @@ public:
     wxFileOffset GetLength() const;
 
     bool Ok() const { return IsOk(); }
     wxFileOffset GetLength() const;
 
     bool Ok() const { return IsOk(); }
-    bool IsOk() const { return m_file->IsOpened(); }
+    virtual bool IsOk() const { return (wxStreamBase::IsOk() && m_file->IsOpened()); }
     bool IsSeekable() const { return m_file->GetKind() == wxFILE_KIND_DISK; }
 
 protected:
     bool IsSeekable() const { return m_file->GetKind() == wxFILE_KIND_DISK; }
 
 protected:
@@ -170,7 +170,7 @@ public:
     wxFileOffset GetLength() const;
 
     bool Ok() const { return IsOk(); }
     wxFileOffset GetLength() const;
 
     bool Ok() const { return IsOk(); }
-    bool IsOk() const { return m_file->IsOpened(); }
+    virtual bool IsOk() const { return (wxStreamBase::IsOk() && m_file->IsOpened()); }
     bool IsSeekable() const { return m_file->GetKind() == wxFILE_KIND_DISK; }
 
 protected:
     bool IsSeekable() const { return m_file->GetKind() == wxFILE_KIND_DISK; }
 
 protected: