]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/include/std/streambuf
Update copyright years in libstdc++-v3/
[thirdparty/gcc.git] / libstdc++-v3 / include / std / streambuf
index b46efec460106b98492c3e2d2eb898cb8f80be9b..865f26b933d4a71f8c20598f393cf5f7fdd19f2a 100644 (file)
@@ -1,7 +1,6 @@
 // Stream buffer classes -*- C++ -*-
 
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-// 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+// Copyright (C) 1997-2014 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -56,6 +55,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  @brief  The actual work of input and output (interface).
    *  @ingroup io
    *
+   *  @tparam _CharT  Type of character stream.
+   *  @tparam _Traits  Traits for character type, defaults to
+   *                   char_traits<_CharT>.
+   *
    *  This is a base class.  Derived stream buffers each control a
    *  pair of character sequences:  one for input, and one for output.
    *
@@ -120,7 +123,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       //@{
       /**
        *  These are standard types.  They permit a standardized way of
-       *  referring to names of (or names dependant on) the template
+       *  referring to names of (or names dependent on) the template
        *  parameters, which are specific to the implementation.
       */
       typedef _CharT                                   char_type;
@@ -142,7 +145,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       friend class ostreambuf_iterator<char_type, traits_type>;
 
       friend streamsize
-      __copy_streambufs_eof<>(__streambuf_type*, __streambuf_type*, bool&);
+      __copy_streambufs_eof<>(basic_streambuf*, basic_streambuf*, bool&);
 
       template<bool _IsMove, typename _CharT2>
         friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, 
@@ -171,20 +174,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
                basic_string<_CharT2, _Traits2, _Alloc>&, _CharT2);
 
     protected:
-      //@{
-      /**
+      /*
        *  This is based on _IO_FILE, just reordered to be more consistent,
        *  and is intended to be the most minimal abstraction for an
        *  internal buffer.
        *  -  get == input == read
        *  -  put == output == write
       */
-      char_type*               _M_in_beg;     // Start of get area. 
-      char_type*               _M_in_cur;     // Current read area. 
-      char_type*               _M_in_end;     // End of get area. 
-      char_type*               _M_out_beg;    // Start of put area. 
-      char_type*               _M_out_cur;    // Current put area. 
-      char_type*               _M_out_end;    // End of put area.
+      char_type*               _M_in_beg;     ///< Start of get area.
+      char_type*               _M_in_cur;     ///< Current read area.
+      char_type*               _M_in_end;     ///< End of get area.
+      char_type*               _M_out_beg;    ///< Start of put area.
+      char_type*               _M_out_cur;    ///< Current put area.
+      char_type*               _M_out_end;    ///< End of put area.
 
       /// Current locale setting.
       locale                   _M_buf_locale;  
@@ -198,13 +200,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       // [27.5.2.2.1] locales
       /**
        *  @brief  Entry point for imbue().
-       *  @param  loc  The new locale.
+       *  @param  __loc  The new locale.
        *  @return  The previous locale.
        *
-       *  Calls the derived imbue(loc).
+       *  Calls the derived imbue(__loc).
       */
       locale 
-      pubimbue(const locale &__loc)
+      pubimbue(const locale__loc)
       {
        locale __tmp(this->getloc());
        this->imbue(__loc);
@@ -233,20 +235,38 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        *  derived @c foo member functions, passing the arguments (if any)
        *  and returning the result unchanged.
       */
-      __streambuf_type* 
+      basic_streambuf*
       pubsetbuf(char_type* __s, streamsize __n) 
       { return this->setbuf(__s, __n); }
 
+      /**
+       *  @brief  Alters the stream position.
+       *  @param  __off  Offset.
+       *  @param  __way  Value for ios_base::seekdir.
+       *  @param  __mode Value for ios_base::openmode.
+       *
+       *  Calls virtual seekoff function.
+      */
       pos_type 
       pubseekoff(off_type __off, ios_base::seekdir __way, 
                 ios_base::openmode __mode = ios_base::in | ios_base::out)
       { return this->seekoff(__off, __way, __mode); }
 
+      /**
+       *  @brief  Alters the stream position.
+       *  @param  __sp  Position
+       *  @param  __mode Value for ios_base::openmode.
+       *
+       *  Calls virtual seekpos function.
+      */
       pos_type 
       pubseekpos(pos_type __sp,
                 ios_base::openmode __mode = ios_base::in | ios_base::out)
       { return this->seekpos(__sp, __mode); }
 
+      /**
+       *  @brief  Calls virtual sync function.
+      */
       int 
       pubsync() { return this->sync(); }
       //@}
@@ -327,11 +347,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       /**
        *  @brief  Entry point for xsgetn.
-       *  @param  s  A buffer area.
-       *  @param  n  A count.
+       *  @param  __s  A buffer area.
+       *  @param  __n  A count.
        *
-       *  Returns xsgetn(s,n).  The effect is to fill @a s[0] through
-       *  @a s[n-1] with characters from the input sequence, if possible.
+       *  Returns xsgetn(__s,__n).  The effect is to fill @a __s[0] through
+       *  @a __s[__n-1] with characters from the input sequence, if possible.
       */
       streamsize 
       sgetn(char_type* __s, streamsize __n)
@@ -340,13 +360,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       // [27.5.2.2.4] putback
       /**
        *  @brief  Pushing characters back into the input stream.
-       *  @param  c  The character to push back.
+       *  @param  __c  The character to push back.
        *  @return  The previous character, if possible.
        *
-       *  Similar to sungetc(), but @a c is pushed onto the stream
+       *  Similar to sungetc(), but @a __c is pushed onto the stream
        *  instead of <em>the previous character.</em> If successful,
        *  the next character fetched from the input stream will be @a
-       *  c.
+       *  __c.
       */
       int_type 
       sputbackc(char_type __c)
@@ -390,15 +410,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       // [27.5.2.2.5] put area
       /**
        *  @brief  Entry point for all single-character output functions.
-       *  @param  c  A character to output.
-       *  @return  @a c, if possible.
+       *  @param  __c  A character to output.
+       *  @return  @a __c, if possible.
        *
        *  One of two public output functions.
        *
        *  If a write position is available for the output sequence (i.e.,
-       *  the buffer is not full), stores @a c in that position, increments
-       *  the position, and returns @c traits::to_int_type(c).  If a write
-       *  position is not available, returns @c overflow(c).
+       *  the buffer is not full), stores @a __c in that position, increments
+       *  the position, and returns @c traits::to_int_type(__c).  If a write
+       *  position is not available, returns @c overflow(__c).
       */
       int_type 
       sputc(char_type __c)
@@ -417,14 +437,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       /**
        *  @brief  Entry point for all single-character output functions.
-       *  @param  s  A buffer read area.
-       *  @param  n  A count.
+       *  @param  __s  A buffer read area.
+       *  @param  __n  A count.
        *
        *  One of two public output functions.
        *
        *
-       *  Returns xsputn(s,n).  The effect is to write @a s[0] through
-       *  @a s[n-1] to the output sequence, if possible.
+       *  Returns xsputn(__s,__n).  The effect is to write @a __s[0] through
+       *  @a __s[__n-1] to the output sequence, if possible.
       */
       streamsize 
       sputn(const char_type* __s, streamsize __n)
@@ -470,7 +490,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       /**
        *  @brief  Moving the read position.
-       *  @param  n  The delta by which to move.
+       *  @param  __n  The delta by which to move.
        *
        *  This just advances the read position without returning any data.
       */
@@ -479,11 +499,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       /**
        *  @brief  Setting the three read area pointers.
-       *  @param  gbeg  A pointer.
-       *  @param  gnext  A pointer.
-       *  @param  gend  A pointer.
-       *  @post  @a gbeg == @c eback(), @a gnext == @c gptr(), and
-       *         @a gend == @c egptr()
+       *  @param  __gbeg  A pointer.
+       *  @param  __gnext  A pointer.
+       *  @param  __gend  A pointer.
+       *  @post  @a __gbeg == @c eback(), @a __gnext == @c gptr(), and
+       *         @a __gend == @c egptr()
       */
       void 
       setg(char_type* __gbeg, char_type* __gnext, char_type* __gend)
@@ -517,7 +537,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       /**
        *  @brief  Moving the write position.
-       *  @param  n  The delta by which to move.
+       *  @param  __n  The delta by which to move.
        *
        *  This just advances the write position without returning any data.
       */
@@ -526,10 +546,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       /**
        *  @brief  Setting the three write area pointers.
-       *  @param  pbeg  A pointer.
-       *  @param  pend  A pointer.
-       *  @post  @a pbeg == @c pbase(), @a pbeg == @c pptr(), and
-       *         @a pend == @c epptr()
+       *  @param  __pbeg  A pointer.
+       *  @param  __pend  A pointer.
+       *  @post  @a __pbeg == @c pbase(), @a __pbeg == @c pptr(), and
+       *         @a __pend == @c epptr()
       */
       void 
       setp(char_type* __pbeg, char_type* __pend)
@@ -542,7 +562,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       // [27.5.2.4.1] locales
       /**
        *  @brief  Changes translations.
-       *  @param  loc  A new locale.
+       *  @param  __loc  A new locale.
        *
        *  Translations done during I/O which depend on the current
        *  locale are changed by this call.  The standard adds,
@@ -553,7 +573,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        *  @note  Base class version does nothing.
       */
       virtual void 
-      imbue(const locale&) 
+      imbue(const locale& __loc
       { }
 
       // [27.5.2.4.2] buffer management and positioning
@@ -630,12 +650,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       /**
        *  @brief  Multiple character extraction.
-       *  @param  s  A buffer area.
-       *  @param  n  Maximum number of characters to assign.
+       *  @param  __s  A buffer area.
+       *  @param  __n  Maximum number of characters to assign.
        *  @return  The number of characters assigned.
        *
-       *  Fills @a s[0] through @a s[n-1] with characters from the input
-       *  sequence, as if by @c sbumpc().  Stops when either @a n characters
+       *  Fills @a __s[0] through @a __s[__n-1] with characters from the input
+       *  sequence, as if by @c sbumpc().  Stops when either @a __n characters
        *  have been copied, or when @c traits::eof() would be copied.
        *
        *  It is expected that derived classes provide a more efficient
@@ -693,7 +713,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       // [27.5.2.4.4] putback
       /**
        *  @brief  Tries to back up the input sequence.
-       *  @param  c  The character to be inserted back into the sequence.
+       *  @param  __c  The character to be inserted back into the sequence.
        *  @return  eof() on failure, <em>some other value</em> on success
        *  @post  The constraints of @c gptr(), @c eback(), and @c pptr()
        *         are the same as for @c underflow().
@@ -701,17 +721,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        *  @note  Base class version does nothing, returns eof().
       */
       virtual int_type 
-      pbackfail(int_type /* __c */  = traits_type::eof())
+      pbackfail(int_type __c  = traits_type::eof())
       { return traits_type::eof(); }
 
       // Put area:
       /**
        *  @brief  Multiple character insertion.
-       *  @param  s  A buffer area.
-       *  @param  n  Maximum number of characters to write.
+       *  @param  __s  A buffer area.
+       *  @param  __n  Maximum number of characters to write.
        *  @return  The number of characters written.
        *
-       *  Writes @a s[0] through @a s[n-1] to the output sequence, as if
+       *  Writes @a __s[0] through @a __s[__n-1] to the output sequence, as if
        *  by @c sputc().  Stops when either @a n characters have been
        *  copied, or when @c sputc() would return @c traits::eof().
        *
@@ -724,9 +744,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       /**
        *  @brief  Consumes data from the buffer; writes to the
        *          controlled sequence.
-       *  @param  c  An additional character to consume.
+       *  @param  __c  An additional character to consume.
        *  @return  eof() to indicate failure, something else (usually
-       *           @a c, or not_eof())
+       *           @a __c, or not_eof())
        *
        *  Informally, this function is called when the output buffer
        *  is full (or does not exist, as buffering need not actually
@@ -734,7 +754,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        *  <em>some effect</em> on the controlled sequence.
        *  (Typically, the buffer is written out to the sequence
        *  verbatim.)  In either case, the character @a c is also
-       *  written out, if @a c is not @c eof().
+       *  written out, if @a __c is not @c eof().
        *
        *  For a formal definition of this function, see a good text
        *  such as Langer & Kreft, or [27.5.2.4.5]/3-7.
@@ -745,7 +765,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        *  @note  Base class version does nothing, returns eof().
       */
       virtual int_type 
-      overflow(int_type /* __c */ = traits_type::eof())
+      overflow(int_type __c  = traits_type::eof())
       { return traits_type::eof(); }
 
 #if _GLIBCXX_USE_DEPRECATED
@@ -779,15 +799,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     private:
       // _GLIBCXX_RESOLVE_LIB_DEFECTS
       // Side effect of DR 50. 
-      basic_streambuf(const __streambuf_type& __sb)
+      basic_streambuf(const basic_streambuf& __sb)
       : _M_in_beg(__sb._M_in_beg), _M_in_cur(__sb._M_in_cur), 
       _M_in_end(__sb._M_in_end), _M_out_beg(__sb._M_out_beg), 
       _M_out_cur(__sb._M_out_cur), _M_out_end(__sb._M_out_cur),
       _M_buf_locale(__sb._M_buf_locale) 
       { }
 
-      __streambuf_type& 
-      operator=(const __streambuf_type&) { return *this; };
+      basic_streambuf&
+      operator=(const basic_streambuf&) { return *this; };
     };
 
   // Explicit specialization declarations, defined in src/streambuf.cc.