参考:http://www.cplusplus.com/reference/sstream/wstringbuf/
std::wstringbuf
typedef basic_stringbuf<wchar_t> wstringbuf;
- wstreambuf
- wstringbuf
Stream buffer to read from and write towstringobjects.
Objects of this class maintain internally a sequence of wide characters that they use as their associated input sequence and/or associated output sequence. The internal sequence can be initialized from awstring object, or copied to one, using memberstr.
Access to the internal sequence of characters is given to streams by means of the interface offered by the virtual members inherited fromwstreambuf that are overriden in this class:
Member types
member type | definition |
---|---|
char_type | wchar_t |
traits_type | char_traits<wchar_t> |
allocator_type | allocator<wchar_t> |
int_type | wint_t |
pos_type | wstreampos |
off_type | streamoff |
Public member functions
Note: The references to the members of its basic template (basic_stringbuf) are linked here.
- (constructor)
- Construct object (public member function )
- str
- Get/set content (public member function )
Public member functions inherited fromwstreambuf
Locales:
- pubimbue
- Imbue locale (public member function )
- getloc
- Get current locale (public member function )
Buffer management and positioning:
- pubsetbuf
- Set buffer array (public member function )
- pubseekoff
- Set internal position pointer to relative position (public member function )
- pubseekpos
- Set internal position pointer to absolute position (public member function )
- pubsync
- Synchronize stream buffer (public member function )
Input functions (get):
- in_avail
- Get number of character available to read (public member function )
- snextc
- Advance to next position and get character (public member function )
- sbumpc
- Get current character and advance to next position (public member function )
- sgetc
- Get current character (public member function )
- sgetn
- Get sequence of characters (public member function )
- sputbackc
- Put character back (public member function )
- sungetc
- Decrease current position (public member function )
Output functions (put):
- sputc
- Put character and advance to next position (public member function )
- sputn
- Put sequence of characters (public member function )
Protected virtual function overrides
Note: The references to the members of its basic template (basic_stringbuf) are linked here.
- setbuf
- Set buffer (protected virtual member function )
- seekoff
- Set position pointer to relative position (protected virtual member function )
- seekpos
- Set position pointer to absolute position (protected virtual member function )
- underflow
- Get character (protected virtual member function )
- pbackfail
- Put character back (protected virtual member function )
- overflow
- Put character (protected virtual member function )
The class also inherits other protected members that are non-virtual or not overridden. See base classwstreambuf for more details.