changeset 15:ceb2499994ce

documentation on Buffer is complete. It will certainly needs some modifications
author Zoltan K
date Sat, 20 Mar 2010 23:28:26 +0100
parents eb31288ea1ae
children 8cafa15f8aca
files src/examples/Buffer/Buffer.hpp
diffstat 1 files changed, 31 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/examples/Buffer/Buffer.hpp	Sat Mar 20 22:10:49 2010 +0100
+++ b/src/examples/Buffer/Buffer.hpp	Sat Mar 20 23:28:26 2010 +0100
@@ -34,6 +34,7 @@
     virtual ~StreamBufferImpl(void) { }
 
 protected:
+
     /**
      ** @brief This method sets a new buffer for the put/get operations
      ** This method is called by pubsetbuf.
@@ -43,6 +44,7 @@
      */
     virtual StreamBufferImpl *  setbuf(char *s, std::streamsize n);
 
+
     /**
      ** @brief This method set the @b get and/or @b put pointer to a relative position.
      ** @param [in] off offset value.
@@ -59,6 +61,7 @@
                                         std::ios_base::seekdir way,
                                         std::ios_base::openmode which = std::ios_base::in | std::ios_base::out);
 
+
     /**
      ** @brief This method set the @b get and/or @b put pointer to an absolute position.
      ** @param [in] sp The pointer new position.
@@ -70,6 +73,7 @@
     virtual std::streampos      seekpos(std::streampos sp,
                                         std::ios_base::openmode which = std::ios_base::in | std::ios_base::out);
 
+
     /**
      ** @brief This method is called when there is a need to synchronize
      ** the buffer's content with the ``real'' content it represents
@@ -88,6 +92,7 @@
      */
     virtual std::streamsize     showmanyc(void);
 
+
     /**
      ** @brief This method gets characters from the buffer.
      ** @param [in] s Array where the gotten characters must be stored.
@@ -95,10 +100,32 @@
      ** @return The number of characters stored.
      */
     virtual std::streamsize     xsgetn(char * s, streamsize n);
+
+
+    /**
+     ** @brief This method is called when there is a need to read data from the buffer
+     ** but there no more data available in it. This method doesn't move the @get pointer.
+     ** @return The new character available at the get pointer position, if any. Otherwise, @c EOF.
+     */
     virtual int                 underflow(void);
+
+
+    /**
+     ** @brief This method is similar to @ref underflow except that it moves the @b get pointer.
+     ** @return The new character available at the get pointer position, if any. Otherwise, @c EOF.
+     */
     virtual int                 uflow(void);
+
+
+    /**
+     ** @brief The strea class allows to putback characters in the buffer. The @ref pbackfail
+     ** method is called when there is an error while putting back a character in the buffer.
+     ** @param [in] c The character to put back.
+     ** @return The method returns @c EOF on failure or any other value if it was successful.
+     */
     virtual int                 pbackfail(int c = EOF);
 
+
     /**
      ** @brief This method add content to the buffer.
      ** @param [in] s An array of char to add to the buffer.
@@ -107,15 +134,17 @@
      */
     virtual streamsize  xsputn(const char * s, streamsize n);
 
+
     /**
      ** @brief This method is called when there is no more
      ** available space on the buffer. This method could be used to allocate a new buffer.
      ** @param [in] c the character to be written
-     ** @return Any value different than EOF in case of success.
-     ** If the function fails, it should return an EOF or throw an exception
+     ** @return Any value different than @c EOF in case of success.
+     ** If the function fails, it should return an @c EOF or throw an exception
      */
     virtual int         overflow(int c = EOF);
 
+
 private:
     /**
      ** @brief std::streambuf has a private copy constructor