003 File Manager
Current Path:
/usr/include/c++/v1/tr1
usr
/
include
/
c++
/
v1
/
tr1
/
📁
..
📄
__bit_reference
(51.94 KB)
📄
__bsd_locale_defaults.h
(2.06 KB)
📄
__bsd_locale_fallbacks.h
(3.94 KB)
📄
__config
(51.99 KB)
📄
__debug
(7.77 KB)
📄
__errc
(9.13 KB)
📄
__functional_03
(43.5 KB)
📄
__functional_base
(17.4 KB)
📄
__functional_base_03
(6.38 KB)
📄
__hash_table
(101.98 KB)
📄
__libcpp_version
(6 B)
📄
__locale
(48.08 KB)
📄
__mutex_base
(16.04 KB)
📄
__node_handle
(5.93 KB)
📄
__nullptr
(1.69 KB)
📄
__split_buffer
(21.9 KB)
📄
__sso_allocator
(2.49 KB)
📄
__std_stream
(10.32 KB)
📄
__string
(46.11 KB)
📄
__threading_support
(20.64 KB)
📄
__tree
(102.38 KB)
📄
__tuple
(20.19 KB)
📄
__undef_macros
(1.02 KB)
📄
algorithm
(199 KB)
📄
any
(18.58 KB)
📄
array
(20.44 KB)
📄
atomic
(96.81 KB)
📄
barrier
(9.98 KB)
📄
bit
(14.13 KB)
📄
bitset
(33 KB)
📄
cassert
(559 B)
📄
ccomplex
(640 B)
📄
cctype
(1.72 KB)
📄
cerrno
(669 B)
📄
cfenv
(1.56 KB)
📄
cfloat
(1.39 KB)
📄
charconv
(17.95 KB)
📄
chrono
(113.59 KB)
📄
cinttypes
(3.44 KB)
📄
ciso646
(595 B)
📄
climits
(907 B)
📄
clocale
(998 B)
📄
cmath
(16.71 KB)
📄
codecvt
(20.12 KB)
📄
compare
(30.14 KB)
📄
complex
(45.51 KB)
📄
complex.h
(739 B)
📄
concepts
(4.63 KB)
📄
condition_variable
(7.43 KB)
📄
csetjmp
(813 B)
📄
csignal
(964 B)
📄
cstdarg
(903 B)
📄
cstdbool
(721 B)
📄
cstddef
(5.29 KB)
📄
cstdint
(2.73 KB)
📄
cstdio
(4.31 KB)
📄
cstdlib
(4.69 KB)
📄
cstring
(2.49 KB)
📄
ctgmath
(650 B)
📄
ctime
(1.67 KB)
📄
ctype.h
(1.12 KB)
📄
cwchar
(6.14 KB)
📄
cwctype
(1.65 KB)
📄
deque
(106.34 KB)
📄
errno.h
(6.19 KB)
📄
exception
(9.25 KB)
📄
execution
(595 B)
📄
fenv.h
(1.82 KB)
📄
filesystem
(80.17 KB)
📄
float.h
(1.58 KB)
📄
forward_list
(61.11 KB)
📄
fstream
(53.05 KB)
📄
functional
(99.54 KB)
📄
future
(70.91 KB)
📄
initializer_list
(2.78 KB)
📄
inttypes.h
(3.8 KB)
📄
iomanip
(17.85 KB)
📄
ios
(24.99 KB)
📄
iosfwd
(8.27 KB)
📄
iostream
(1.36 KB)
📄
istream
(46.73 KB)
📄
iterator
(70.11 KB)
📄
latch
(2.35 KB)
📄
limits
(39.71 KB)
📄
limits.h
(1.44 KB)
📄
list
(78.48 KB)
📄
locale
(150.64 KB)
📄
locale.h
(776 B)
📄
map
(82.59 KB)
📄
math.h
(48.03 KB)
📄
memory
(160.89 KB)
📄
mutex
(17.25 KB)
📄
new
(13.79 KB)
📄
numbers
(6.74 KB)
📄
numeric
(20.08 KB)
📄
optional
(41.59 KB)
📄
ostream
(32.02 KB)
📄
queue
(27.47 KB)
📄
random
(221.29 KB)
📄
ratio
(16.04 KB)
📄
regex
(219.62 KB)
📄
scoped_allocator
(25.14 KB)
📄
semaphore
(6.52 KB)
📄
set
(55.98 KB)
📄
setjmp.h
(802 B)
📄
shared_mutex
(14.75 KB)
📄
span
(22.41 KB)
📄
sstream
(32.59 KB)
📄
stack
(9.86 KB)
📄
stdbool.h
(815 B)
📄
stddef.h
(1.08 KB)
📄
stdexcept
(7.66 KB)
📄
stdint.h
(2.27 KB)
📄
stdio.h
(3.44 KB)
📄
stdlib.h
(5.1 KB)
📄
streambuf
(14.18 KB)
📄
string
(163.38 KB)
📄
string.h
(4.58 KB)
📄
string_view
(33.74 KB)
📄
strstream
(10.88 KB)
📄
system_error
(13.88 KB)
📄
tgmath.h
(732 B)
📄
thread
(11.13 KB)
📄
tuple
(55.25 KB)
📄
type_traits
(147.84 KB)
📄
typeindex
(2.76 KB)
📄
typeinfo
(11.27 KB)
📄
unordered_map
(97.16 KB)
📄
unordered_set
(67.79 KB)
📄
utility
(48.28 KB)
📄
valarray
(131.97 KB)
📄
variant
(60.89 KB)
📄
vector
(109.43 KB)
📄
version
(14.98 KB)
📄
wchar.h
(8.24 KB)
📄
wctype.h
(1.52 KB)
Editing: strstream
// -*- C++ -*- //===--------------------------- strstream --------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP_STRSTREAM #define _LIBCPP_STRSTREAM /* strstream synopsis class strstreambuf : public basic_streambuf<char> { public: explicit strstreambuf(streamsize alsize_arg = 0); strstreambuf(void* (*palloc_arg)(size_t), void (*pfree_arg)(void*)); strstreambuf(char* gnext_arg, streamsize n, char* pbeg_arg = 0); strstreambuf(const char* gnext_arg, streamsize n); strstreambuf(signed char* gnext_arg, streamsize n, signed char* pbeg_arg = 0); strstreambuf(const signed char* gnext_arg, streamsize n); strstreambuf(unsigned char* gnext_arg, streamsize n, unsigned char* pbeg_arg = 0); strstreambuf(const unsigned char* gnext_arg, streamsize n); strstreambuf(strstreambuf&& rhs); strstreambuf& operator=(strstreambuf&& rhs); virtual ~strstreambuf(); void swap(strstreambuf& rhs); void freeze(bool freezefl = true); char* str(); int pcount() const; protected: virtual int_type overflow (int_type c = EOF); virtual int_type pbackfail(int_type c = EOF); virtual int_type underflow(); virtual pos_type seekoff(off_type off, ios_base::seekdir way, ios_base::openmode which = ios_base::in | ios_base::out); virtual pos_type seekpos(pos_type sp, ios_base::openmode which = ios_base::in | ios_base::out); virtual streambuf* setbuf(char* s, streamsize n); private: typedef T1 strstate; // exposition only static const strstate allocated; // exposition only static const strstate constant; // exposition only static const strstate dynamic; // exposition only static const strstate frozen; // exposition only strstate strmode; // exposition only streamsize alsize; // exposition only void* (*palloc)(size_t); // exposition only void (*pfree)(void*); // exposition only }; class istrstream : public basic_istream<char> { public: explicit istrstream(const char* s); explicit istrstream(char* s); istrstream(const char* s, streamsize n); istrstream(char* s, streamsize n); virtual ~istrstream(); strstreambuf* rdbuf() const; char *str(); private: strstreambuf sb; // exposition only }; class ostrstream : public basic_ostream<char> { public: ostrstream(); ostrstream(char* s, int n, ios_base::openmode mode = ios_base::out); virtual ~ostrstream(); strstreambuf* rdbuf() const; void freeze(bool freezefl = true); char* str(); int pcount() const; private: strstreambuf sb; // exposition only }; class strstream : public basic_iostream<char> { public: // Types typedef char char_type; typedef char_traits<char>::int_type int_type; typedef char_traits<char>::pos_type pos_type; typedef char_traits<char>::off_type off_type; // constructors/destructor strstream(); strstream(char* s, int n, ios_base::openmode mode = ios_base::in | ios_base::out); virtual ~strstream(); // Members: strstreambuf* rdbuf() const; void freeze(bool freezefl = true); int pcount() const; char* str(); private: strstreambuf sb; // exposition only }; } // std */ #include <__config> #include <ostream> #include <istream> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD class _LIBCPP_TYPE_VIS strstreambuf : public streambuf { public: explicit strstreambuf(streamsize __alsize = 0); strstreambuf(void* (*__palloc)(size_t), void (*__pfree)(void*)); strstreambuf(char* __gnext, streamsize __n, char* __pbeg = 0); strstreambuf(const char* __gnext, streamsize __n); strstreambuf(signed char* __gnext, streamsize __n, signed char* __pbeg = 0); strstreambuf(const signed char* __gnext, streamsize __n); strstreambuf(unsigned char* __gnext, streamsize __n, unsigned char* __pbeg = 0); strstreambuf(const unsigned char* __gnext, streamsize __n); #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY strstreambuf(strstreambuf&& __rhs); _LIBCPP_INLINE_VISIBILITY strstreambuf& operator=(strstreambuf&& __rhs); #endif // _LIBCPP_CXX03_LANG virtual ~strstreambuf(); void swap(strstreambuf& __rhs); void freeze(bool __freezefl = true); char* str(); int pcount() const; protected: virtual int_type overflow (int_type __c = EOF); virtual int_type pbackfail(int_type __c = EOF); virtual int_type underflow(); virtual pos_type seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __which = ios_base::in | ios_base::out); virtual pos_type seekpos(pos_type __sp, ios_base::openmode __which = ios_base::in | ios_base::out); private: typedef unsigned __mode_type; static const __mode_type __allocated = 0x01; static const __mode_type __constant = 0x02; static const __mode_type __dynamic = 0x04; static const __mode_type __frozen = 0x08; static const streamsize __default_alsize = 4096; __mode_type __strmode_; streamsize __alsize_; void* (*__palloc_)(size_t); void (*__pfree_)(void*); void __init(char* __gnext, streamsize __n, char* __pbeg); }; #ifndef _LIBCPP_CXX03_LANG inline _LIBCPP_INLINE_VISIBILITY strstreambuf::strstreambuf(strstreambuf&& __rhs) : streambuf(__rhs), __strmode_(__rhs.__strmode_), __alsize_(__rhs.__alsize_), __palloc_(__rhs.__palloc_), __pfree_(__rhs.__pfree_) { __rhs.setg(nullptr, nullptr, nullptr); __rhs.setp(nullptr, nullptr); } inline _LIBCPP_INLINE_VISIBILITY strstreambuf& strstreambuf::operator=(strstreambuf&& __rhs) { if (eback() && (__strmode_ & __allocated) != 0 && (__strmode_ & __frozen) == 0) { if (__pfree_) __pfree_(eback()); else delete [] eback(); } streambuf::operator=(__rhs); __strmode_ = __rhs.__strmode_; __alsize_ = __rhs.__alsize_; __palloc_ = __rhs.__palloc_; __pfree_ = __rhs.__pfree_; __rhs.setg(nullptr, nullptr, nullptr); __rhs.setp(nullptr, nullptr); return *this; } #endif // _LIBCPP_CXX03_LANG class _LIBCPP_TYPE_VIS istrstream : public istream { public: _LIBCPP_INLINE_VISIBILITY explicit istrstream(const char* __s) : istream(&__sb_), __sb_(__s, 0) {} _LIBCPP_INLINE_VISIBILITY explicit istrstream(char* __s) : istream(&__sb_), __sb_(__s, 0) {} _LIBCPP_INLINE_VISIBILITY istrstream(const char* __s, streamsize __n) : istream(&__sb_), __sb_(__s, __n) {} _LIBCPP_INLINE_VISIBILITY istrstream(char* __s, streamsize __n) : istream(&__sb_), __sb_(__s, __n) {} #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY istrstream(istrstream&& __rhs) : istream(_VSTD::move(__rhs)), __sb_(_VSTD::move(__rhs.__sb_)) { istream::set_rdbuf(&__sb_); } _LIBCPP_INLINE_VISIBILITY istrstream& operator=(istrstream&& __rhs) { istream::operator=(_VSTD::move(__rhs)); __sb_ = _VSTD::move(__rhs.__sb_); return *this; } #endif // _LIBCPP_CXX03_LANG virtual ~istrstream(); _LIBCPP_INLINE_VISIBILITY void swap(istrstream& __rhs) { istream::swap(__rhs); __sb_.swap(__rhs.__sb_); } _LIBCPP_INLINE_VISIBILITY strstreambuf* rdbuf() const {return const_cast<strstreambuf*>(&__sb_);} _LIBCPP_INLINE_VISIBILITY char *str() {return __sb_.str();} private: strstreambuf __sb_; }; class _LIBCPP_TYPE_VIS ostrstream : public ostream { public: _LIBCPP_INLINE_VISIBILITY ostrstream() : ostream(&__sb_) {} _LIBCPP_INLINE_VISIBILITY ostrstream(char* __s, int __n, ios_base::openmode __mode = ios_base::out) : ostream(&__sb_), __sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0)) {} #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY ostrstream(ostrstream&& __rhs) : ostream(_VSTD::move(__rhs)), __sb_(_VSTD::move(__rhs.__sb_)) { ostream::set_rdbuf(&__sb_); } _LIBCPP_INLINE_VISIBILITY ostrstream& operator=(ostrstream&& __rhs) { ostream::operator=(_VSTD::move(__rhs)); __sb_ = _VSTD::move(__rhs.__sb_); return *this; } #endif // _LIBCPP_CXX03_LANG virtual ~ostrstream(); _LIBCPP_INLINE_VISIBILITY void swap(ostrstream& __rhs) { ostream::swap(__rhs); __sb_.swap(__rhs.__sb_); } _LIBCPP_INLINE_VISIBILITY strstreambuf* rdbuf() const {return const_cast<strstreambuf*>(&__sb_);} _LIBCPP_INLINE_VISIBILITY void freeze(bool __freezefl = true) {__sb_.freeze(__freezefl);} _LIBCPP_INLINE_VISIBILITY char* str() {return __sb_.str();} _LIBCPP_INLINE_VISIBILITY int pcount() const {return __sb_.pcount();} private: strstreambuf __sb_; // exposition only }; class _LIBCPP_TYPE_VIS strstream : public iostream { public: // Types typedef char char_type; typedef char_traits<char>::int_type int_type; typedef char_traits<char>::pos_type pos_type; typedef char_traits<char>::off_type off_type; // constructors/destructor _LIBCPP_INLINE_VISIBILITY strstream() : iostream(&__sb_) {} _LIBCPP_INLINE_VISIBILITY strstream(char* __s, int __n, ios_base::openmode __mode = ios_base::in | ios_base::out) : iostream(&__sb_), __sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0)) {} #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY strstream(strstream&& __rhs) : iostream(_VSTD::move(__rhs)), __sb_(_VSTD::move(__rhs.__sb_)) { iostream::set_rdbuf(&__sb_); } _LIBCPP_INLINE_VISIBILITY strstream& operator=(strstream&& __rhs) { iostream::operator=(_VSTD::move(__rhs)); __sb_ = _VSTD::move(__rhs.__sb_); return *this; } #endif // _LIBCPP_CXX03_LANG virtual ~strstream(); _LIBCPP_INLINE_VISIBILITY void swap(strstream& __rhs) { iostream::swap(__rhs); __sb_.swap(__rhs.__sb_); } // Members: _LIBCPP_INLINE_VISIBILITY strstreambuf* rdbuf() const {return const_cast<strstreambuf*>(&__sb_);} _LIBCPP_INLINE_VISIBILITY void freeze(bool __freezefl = true) {__sb_.freeze(__freezefl);} _LIBCPP_INLINE_VISIBILITY int pcount() const {return __sb_.pcount();} _LIBCPP_INLINE_VISIBILITY char* str() {return __sb_.str();} private: strstreambuf __sb_; // exposition only }; _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP_STRSTREAM
Upload File
Create Folder