]> git.saurik.com Git - wxWidgets.git/blobdiff - interface/wx/stream.h
blind fix for yet another VC6 compilation error
[wxWidgets.git] / interface / wx / stream.h
index 5d02acabb6c966021805d46021d024642465eed3..b2a8c9cb9028adeefc68750db07d746e3d7aa651 100644 (file)
@@ -60,12 +60,34 @@ class wxBufferedInputStream : public wxFilterInputStream
 {
 public:
     /**
-        Constructor.
-        If a non @NULL buffer is given to the stream, it will be deleted by it.
+        Constructor using the provided buffer or default.
+
+        @param stream
+            The associated low-level stream.
+        @param buffer
+            The buffer to use if non-@NULL. Notice that the ownership of this
+            buffer is taken by the stream, i.e. it will delete it. If this
+            parameter is @NULL a default 1KB buffer is used.
     */
     wxBufferedInputStream(wxInputStream& stream,
                           wxStreamBuffer *buffer = NULL);
 
+    /**
+        Constructor allowing to specify the size of the buffer.
+
+        This is just a more convenient alternative to creating a wxStreamBuffer
+        of the given size and using the other overloaded constructor of this
+        class.
+
+        @param stream
+            The associated low-level stream.
+        @param bufsize
+            The size of the buffer, in bytes.
+
+        @since 2.9.0
+     */
+    wxBufferedInputStream(wxInputStream& stream, size_t bufsize);
+
     /**
         Destructor.
     */
@@ -112,6 +134,26 @@ public:
     */
     wxStreamBuffer(wxStreamBase& stream, BufMode mode);
 
+    /**
+        Constructor for an input buffer of the specified size.
+
+        Using it is equivalent to using the constructor above with read mode
+        and calling SetBufferIO() but is more convenient.
+
+        @since 2.9.0
+     */
+    wxStreamBuffer(wxInputStream& stream, size_t bufsize);
+
+    /**
+        Constructor for an output buffer of the specified size.
+
+        Using it is equivalent to using the constructor above with write mode
+        and calling SetBufferIO() but is more convenient.
+
+        @since 2.9.0
+     */
+    wxStreamBuffer(wxOutputStream& stream, size_t bufsize);
+
     /**
         Constructor; creates a new empty stream buffer which won't flush any data
         to a stream. mode specifies the type of the buffer (read, write, read_write).
@@ -130,7 +172,7 @@ public:
     wxStreamBuffer(BufMode mode);
 
     /**
-        Constructor.
+        Copy constructor.
 
         This method initializes the stream buffer with the data of the specified
         stream buffer. The new stream buffer has the same attributes, size, position
@@ -212,7 +254,7 @@ public:
     /**
         Returns the current position (counted in bytes) in the stream buffer.
     */
-    wxFileOffset GetIntPosition() const;
+    size_t GetIntPosition() const;
 
     /**
         Returns the amount of bytes read during the last IO call to the parent stream.
@@ -537,7 +579,7 @@ public:
             list << *p << _T("\n");
         @endcode
     */
-    const wxChar* const* GetProtocols(wxStreamProtocolType type = wxSTREAM_PROTOCOL) const;
+    virtual const wxChar * const* GetProtocols(wxStreamProtocolType type = wxSTREAM_PROTOCOL) const = 0;
 
     //@{
     /**
@@ -670,10 +712,34 @@ class wxBufferedOutputStream : public wxFilterOutputStream
 {
 public:
     /**
-        @todo WRITE DESCRIPTION
+        Constructor using the provided buffer or default.
+
+        @param stream
+            The associated low-level stream.
+        @param buffer
+            The buffer to use if non-@NULL. Notice that the ownership of this
+            buffer is taken by the stream, i.e. it will delete it. If this
+            parameter is @NULL a default 1KB buffer is used.
     */
     wxBufferedOutputStream(wxOutputStream& stream,
                            wxStreamBuffer *buffer = NULL);
+
+    /**
+        Constructor allowing to specify the size of the buffer.
+
+        This is just a more convenient alternative to creating a wxStreamBuffer
+        of the given size and using the other overloaded constructor of this
+        class.
+
+        @param stream
+            The associated low-level stream.
+        @param bufsize
+            The size of the buffer, in bytes.
+
+        @since 2.9.0
+     */
+    wxBufferedOutputStream(wxOutputStream& stream, size_t bufsize);
+
     /**
         Destructor. Calls Sync() and destroys the internal buffer.
     */
@@ -682,7 +748,7 @@ public:
     /**
         Calls Sync() and changes the stream position.
     */
-    virtual wxFileOffset SeekO(wxFileOffset pos, wxSeekMode mode = wxFromStart)
+    virtual wxFileOffset SeekO(wxFileOffset pos, wxSeekMode mode = wxFromStart);
 
     /**
         Flushes the buffer and calls Sync() on the parent stream.
@@ -729,7 +795,7 @@ public:
         Returns the first character in the input queue and removes it,
         blocking until it appears if necessary.
     */
-    char GetC();
+    int GetC();
 
     /**
         Returns the last number of bytes read.
@@ -884,20 +950,23 @@ public:
     size_t OnSysRead(void* buffer, size_t bufsize);
 
     /**
-        Internal function.
-        It is called when the stream needs to change the current position.
+        See OnSysRead().
     */
-    wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode);
+    size_t OnSysWrite(const void* buffer, size_t bufsize);
+
+
+protected:
 
     /**
         Internal function.
-        It is called when the stream needs to know the real position.
+        It is called when the stream needs to change the current position.
     */
-    wxFileOffset OnSysTell() const;
+    virtual wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode);
 
     /**
-        See OnSysRead().
+        Internal function.
+        It is called when the stream needs to know the real position.
     */
-    size_t OnSysWrite(const void* buffer, size_t bufsize);
+    virtual wxFileOffset OnSysTell() const;
 };