 
 - C++ Library - Home
- C++ Library - <fstream>
- C++ Library - <iomanip>
- C++ Library - <ios>
- C++ Library - <iosfwd>
- C++ Library - <iostream>
- C++ Library - <istream>
- C++ Library - <ostream>
- C++ Library - <sstream>
- C++ Library - <streambuf>
- C++ Library - <atomic>
- C++ Library - <complex>
- C++ Library - <exception>
- C++ Library - <functional>
- C++ Library - <limits>
- C++ Library - <locale>
- C++ Library - <memory>
- C++ Library - <new>
- C++ Library - <numeric>
- C++ Library - <regex>
- C++ Library - <stdexcept>
- C++ Library - <string>
- C++ Library - <thread>
- C++ Library - <tuple>
- C++ Library - <typeinfo>
- C++ Library - <utility>
- C++ Library - <valarray>
- The C++ STL Library
- C++ Library - <array>
- C++ Library - <bitset>
- C++ Library - <deque>
- C++ Library - <forward_list>
- C++ Library - <list>
- C++ Library - <map>
- C++ Library - <multimap>
- C++ Library - <queue>
- C++ Library - <priority_queue>
- C++ Library - <set>
- C++ Library - <multiset >
- C++ Library - <stack>
- C++ Library - <unordered_map>
- C++ Library - <unordered_set>
- C++ Library - <vector>
- C++ Library - <algorithm>
- C++ Library - <iterator>
- The C++ Advanced Library
- C++ Library - <any>
- C++ Library - <barrier>
- C++ Library - <bit>
- C++ Library - <chrono>
- C++ Library - <cinttypes>
- C++ Library - <clocale>
- C++ Library - <condition_variable>
- C++ Library - <coroutine>
- C++ Library - <cstdlib>
- C++ Library - <cstring>
- C++ Library - <cuchar>
- C++ Library - <charconv>
- C++ Library - <cfenv>
- C++ Library - <cmath>
- C++ Library - <ccomplex>
- C++ Library - <expected>
- C++ Library - <format>
- C++ Library - <future>
- C++ Library - <flat_set>
- C++ Library - <flat_map>
- C++ Library - <filesystem>
- C++ Library - <generator>
- C++ Library - <initializer_list>
- C++ Library - <latch>
- C++ Library - <memory_resource>
- C++ Library - <mutex>
- C++ Library - <mdspan>
- C++ Library - <optional>
- C++ Library - <print>
- C++ Library - <ratio>
- C++ Library - <scoped_allocator>
- C++ Library - <semaphore>
- C++ Library - <source_location>
- C++ Library - <span>
- C++ Library - <spanstream>
- C++ Library - <stacktrace>
- C++ Library - <stop_token>
- C++ Library - <syncstream>
- C++ Library - <system_error>
- C++ Library - <string_view>
- C++ Library - <stdatomic>
- C++ Library - <variant>
- C++ STL Library Cheat Sheet
- C++ STL - Cheat Sheet
- C++ Programming Resources
- C++ Programming Tutorial
- C++ Useful Resources
- C++ Discussion
C++ Library - <basic_stringstream>
Introduction
It is a stream class to operate on strings.bjects of this class use a string buffer that contains a sequence of characters. This sequence of characters can be accessed directly as a basic_string object, using member str.
Definition
Below is definition of std::basic_stringstream.
template < class charT, class traits = char_traits<charT>, class Alloc = allocator<charT> > class basic_stringstream;
Parameters
- charT − Character type. 
- traits − Character traits class that defines essential properties of the characters used by stream objects. 
- int_type − Integer Type. 
- pos_type − Traints Pos Type. 
- off_type − Traints Off Type. 
- allocator_type − Allocator. 
Member types
| Sr.No. | Member types | Definition | 
|---|---|---|
| 1 | event | Type to indicate event type | 
| 2 | event_callback | Event callback function type | 
| 3 | failure | Base class for stream exceptions | 
| 4 | fmtflags | Type for stream format flags | 
| 5 | Init | Initialize standard stream objects | 
| 6 | iostate | Type for stream state flags | 
| 7 | openmode | Type for stream opening mode flags | 
| 8 | seekdir | Type for stream seeking direction flag | 
| 9 | basic_istream::sentry | It is used to prepare stream for input | 
| 10 | seekdirbasic_ostream::sentry | It is used to prepare stream for output | 
Public Member Functions
| Sr.No. | Member types | Definition | 
|---|---|---|
| 1 | (constructor) | Construct object (public member function ) | 
| 2 | (destructor) | Destruct object (public member function ) | 
Public member functions
| Sr.No. | Member Functions | Definition | 
|---|---|---|
| 1 | gcount | It is used to get character count | 
| 2 | get | It is used to get characters | 
| 3 | getline | It is used to get line | 
| 4 | ignore | It is used to extract and discard characters | 
| 5 | peek | It is used to peek next character | 
| 6 | read | It is used to read block of data | 
| 7 | readsome | It is used to Read data available in buffer | 
| 8 | putback | It is used to put character back | 
| 9 | unget | It is used to unget character | 
Formatted output
| Sr.No. | Output | Definition | 
|---|---|---|
| 1 | operator>> | It is used to extract formatted input | 
| 2 | operator= | It is used to move assignment | 
| 3 | swap | It is used to swap internals | 
Unformatted output
| Sr.No. | Output | Definition | 
|---|---|---|
| 1 | put | It is used to put character | 
| 2 | write | It is used to write block of data | 
Positioning
| Sr.No. | Position | Definition | 
|---|---|---|
| 1 | tellp | It is used to get position in output sequence | 
| 2 | seekp | It is used to set position in output sequence | 
Synchronization
| Sr.No. | Synchronization | Definition | 
|---|---|---|
| 1 | flush | It is used to flush output stream buffer | 
Public member functions inherited from basic_ios
| Sr.No. | Member types | Definition | 
|---|---|---|
| 1 | good | It is used to check whether state of stream is good | 
| 2 | eof | It is used to check whether eofbit is set | 
| 3 | fail | It is used to check whether either failbit or badbit is set | 
| 4 | bad | It is used to check whether badbit is set | 
| 5 | operator! | Evaluate stream | 
| 6 | rdstate | It is used to get error state flags | 
| 7 | setstate | It is used to set error state flag | 
| 8 | clear | It is used to set error state flag | 
| 9 | fill | Get/set fill character | 
| 10 | exceptions | It is used to get/set exceptions mask | 
| 11 | imbue | Imbue locale | 
| 12 | tie | It is used to get/set tied stream | 
| 13 | rdbuf | It is used to get/set stream buffer | 
| 14 | narrow | Narrow character | 
| 15 | widen | Widen character | 
sstream.htm
  Advertisements