Namespaces
Variants
Views
Actions

std::basic_stringbuf

From cppreference.com
< cpp‎ | io
Revision as of 06:50, 14 December 2011 by Cubbi (Talk | contribs)

Template:cpp/io/basic stringbuf/sidebar

Defined in header <sstream>
template<

    class charT,
    class Traits = std::char_traits<CharT>,
    class Allocator = std::allocator<CharT>

> class basic_stringbuf : public std::basic_streambuf<CharT, Traits>

std::basic_stringbuf is a specialization of Template:cpp whose associated character sequence is a memory-resident sequence of arbitrary characters, which can be initialized from or made available as an instance of Template:cpp.

Typical implementations of std::basic_stringbuf hold an object of type Template:cpp directly as a data member and use it as both the controlled character sequence (the array where the six pointers of Template:cpp are pointing to) and as the associated character sequence (the source of characters for all input operations and the target for the output). In addition, a typical implementation holds a data member of type Template:cpp to indicate the status of the stream (input-only, output-only, or input/output).

Two specializations for common character types are also defined:

Template:tdcl list begin Template:tdcl list header Template:tdcl list hitem Template:tdcl list item Template:tdcl list item Template:tdcl list end

Contents

Member types

Template:tdcl list begin Template:tdcl list hitem Template:tdcl list template Template:tdcl list template Template:tdcl list template Template:tdcl list template Template:tdcl list template Template:tdcl list template Template:tdcl list end

Member functions

Public member functions

constructs a basic_stringbuf object
(public member function)
(C++11)
assigns a basic_stringbuf object
(public member function)
(C++11)
swaps two basic_stringbuf objects
(public member function)
replaces or obtains a copy of the associated character string
(public member function)

Protected member functions

[virtual]
returns the next character available in the input sequence
(virtual protected member function)
[virtual]
puts a character back into the input sequence
(virtual protected member function)
[virtual]
appends a character to the output sequence
(virtual protected member function)
[virtual]
attempts to replace the controlled character sequence with an array
(virtual protected member function)
[virtual]
repositions the next pointer in the input sequence, output sequence, or both, using relative addressing
(virtual protected member function)
[virtual]
repositions the next pointer in the input sequence, output sequence, or both using absolute addressing
(virtual protected member function)

Non-member functions

specializes the Template:cpp algorithm
(function template)