Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
std::basic_...f::pbackfail(3) C++ Standard Libarystd::basic_...f::pbackfail(3)

NAME
       std::basic_streambuf::pbackfail - std::basic_streambuf::pbackfail

Synopsis
	  protected:
	  virtual int_type pbackfail( int_type c = Traits::eof() );

	  This	protected  virtual  function is	called by the public functions
       sungetc() and
	  sputbackc() (which, in turn, are called by basic_istream::unget and
	  basic_istream::putback) when either:

	  1) There is no putback position in  the  get	area  (pbackfail()  is
       called with no
	  arguments). In this situation, the purpose of	pbackfail() is to back
       up the get area
	  by  one  character, if the associated	character sequence allows this
       (e.g. a
	  file-backed streambuf	may reload the buffer from  a  file,  starting
       one character
	  earlier).
	  2) The caller	attempts to putback a different	character from the one
       retrieved
	  earlier  (pbackfail()	 is called with	the character that needs to be
       put back). In
	  this situation, the purpose of pbackfail() is	to place the character
       c into the get
	  area at the position just before  basic_streambuf::gptr(),  and,  if
       possible, to
	  modify  the  associated  character  sequence to reflect this change.
       This may	involve
	  backing up the get area as in	the first variant.

	  The default base class version of this function does nothing and re-
       turns
	  Traits::eof()	in all situations. This	function is overridden by  the
       derived classes:
	  basic_stringbuf::pbackfail,	basic_filebuf::pbackfail,   strstream-
       buf::pbackfail, and
	  is expected to be overridden by user-defined and third-party library
       stream classes.

Parameters
	  ch - character to put	back or	Traits::eof() if only back out is  re-
       quested

Return value
	  Traits::eof()	 in case of failure, some other	value to indicate suc-
       cess. The base
	  class	version	always fails.

Example
	   This	section	is incomplete
	   Reason: no example

See also
	  pbackfail backs out the input	sequence to unget a character, not af-
       fecting the
	  [virtual] associated file
		    (virtual protected	member	function  of  std::basic_file-
       buf<CharT,Traits>)
	  pbackfail puts a character back into the input sequence
	  [virtual] (virtual protected member function of
		    std::basic_stringbuf<CharT,Traits,Allocator>)
	  pbackfail backs out the input	sequence to unget a character
	  [virtual] (virtual protected member function of std::strstreambuf)
	  sungetc   moves the next pointer in the input	sequence back by one
		    (public member function)
	  sputbackc puts one character back in the input sequence
		    (public member function)

http://cppreference.com		  2022.07.31	 std::basic_...f::pbackfail(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=std::wstreambuf::pbackfail&sektion=3&manpath=FreeBSD+Ports+15.0>

home | help