#pragma once
#ifndef _STREAMBUF_
#define _STREAMBUF_
#ifndef RC_INVOKED
#include <xiosbase>
#pragma pack(push,_CRT_PACKING)
#pragma warning(push,_STL_WARNING_LEVEL)
#pragma warning(disable: _STL_DISABLED_WARNINGS)
#pragma warning(disable:
4455
4494
4619
4643
4702
4984
4988
)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
template
<
class
,
class
>
class
{
protected
:
__CLR_OR_THIS_CALL basic_streambuf()
: _Plocale(
new
)
{
();
}
__CLR_OR_THIS_CALL basic_streambuf(_Uninitialized)
{
}
__CLR_OR_THIS_CALL basic_streambuf(const basic_streambuf& _Right)
: _Plocale(
new
(
.
()))
{
();
(
.
(),
.
(),
.
());
(
.
(),
.
(),
.
());
}
basic_streambuf& __CLR_OR_THIS_CALL operator=(const basic_streambuf& _Right)
{
if (this != _STD addressof(_Right))
{
(
.
(),
.
(),
.
());
(
.
(),
.
(),
.
());
(
.
());
}
return
(*
this
);
}
void __CLR_OR_THIS_CALL swap(basic_streambuf& _Right)
{
if (this != _STD addressof(_Right))
{
*
=
();
*
=
();
*
=
();
*
=
();
*
=
();
*
=
();
(
.
(),
.
(),
.
());
.
(
_Pfirst0
,
_Pnext0
,
_Pend
);
(
.
(),
.
(),
.
());
.
(
_Gfirst0
,
_Gnext0
,
_Gend
);
_STD swap(_Plocale, _Right._Plocale);
}
}
public
:
typedef
;
typedef
;
virtual __CLR_OR_THIS_CALL ~basic_streambuf() noexcept
{
delete
;
}
typedef
typename
::int_type
;
typedef
typename
::pos_type
;
typedef
typename
::off_type
;
pos_type __CLR_OR_THIS_CALL pubseekoff(off_type _Off,
::
,
::
=
::
|
::
)
{
return
(
(
,
,
));
}
#if _HAS_OLD_IOSTREAMS_MEMBERS
pos_type __CLR_OR_THIS_CALL pubseekoff(off_type _Off,
::
,
::
)
{
return
(
(
, (
::
)
,
(
::
)
));
}
#endif /* _HAS_OLD_IOSTREAMS_MEMBERS */
pos_type __CLR_OR_THIS_CALL pubseekpos(pos_type _Pos,
::
=
::
|
::
)
{
return
(
(
,
));
}
#if _HAS_OLD_IOSTREAMS_MEMBERS
pos_type __CLR_OR_THIS_CALL pubseekpos(pos_type _Pos,
::
)
{
return
(
(
, (
::
)
));
}
#endif /* _HAS_OLD_IOSTREAMS_MEMBERS */
basic_streambuf *__CLR_OR_THIS_CALL pubsetbuf(_Elem *_Buffer,
)
{
return
(
(
,
));
}
locale __CLR_OR_THIS_CALL pubimbue(const locale &_Newlocale)
{
= *
;
(
);
*
;
return
(
_Oldlocale
);
}
locale __CLR_OR_THIS_CALL getloc() const
{
return
(*
);
}
streamsize __CLR_OR_THIS_CALL in_avail()
{
=
();
return
(
0
_Res
?
_Res
:
());
}
int __CLR_OR_THIS_CALL pubsync()
{
return
(
());
}
int_type __CLR_OR_THIS_CALL sbumpc()
{
return
(
0
()
?
::to_int_type(*
()) :
());
}
int_type __CLR_OR_THIS_CALL sgetc()
{
return
(
0
()
?
::to_int_type(*
()) :
());
}
streamsize __CLR_OR_THIS_CALL sgetn(_Elem *_Ptr,
)
{
return
(
(
,
));
}
int_type __CLR_OR_THIS_CALL snextc()
{
return
(
1
()
?
::to_int_type(*
())
:
::eq_int_type(
::eof(),
())
?
::eof() :
());
}
int_type __CLR_OR_THIS_CALL sputbackc(_Elem _Ch)
{
return
(
() !=
nullptr
&&
() <
()
&&
::eq(
,
()[-
1
])
?
::to_int_type(*
())
:
(
::to_int_type(
)));
}
#if _HAS_OLD_IOSTREAMS_MEMBERS
void __CLR_OR_THIS_CALL stossc()
{
if
(
0
())
();
else
();
}
#endif /* _HAS_OLD_IOSTREAMS_MEMBERS */
int_type __CLR_OR_THIS_CALL sungetc()
{
return
(
() !=
nullptr
&&
() <
()
?
::to_int_type(*
()) :
());
}
int_type __CLR_OR_THIS_CALL sputc(_Elem _Ch)
{
return
(
0
()
?
::to_int_type(*
() =
)
:
(
::to_int_type(
)));
}
streamsize __CLR_OR_THIS_CALL sputn(const _Elem *_Ptr,
)
{
return
(
(
,
));
}
virtual void __CLR_OR_THIS_CALL _Lock()
{
}
virtual void __CLR_OR_THIS_CALL _Unlock()
{
}
protected
:
_Elem *__CLR_OR_THIS_CALL eback() const
{
return
(*
);
}
_Elem *__CLR_OR_THIS_CALL gptr() const
{
return
(*
);
}
_Elem *__CLR_OR_THIS_CALL pbase() const
{
return
(*
);
}
_Elem *__CLR_OR_THIS_CALL pptr() const
{
return
(*
);
}
_Elem *__CLR_OR_THIS_CALL egptr() const
{
return
(*
+ *
);
}
void __CLR_OR_THIS_CALL gbump(int _Off)
{
*
-=
;
*
+=
;
}
void __CLR_OR_THIS_CALL setg(_Elem *_First, _Elem *_Next, _Elem *_Last)
{
*
=
;
*
=
;
*
= (
int
)(
-
);
}
_Elem *__CLR_OR_THIS_CALL epptr() const
{
return
(*
+ *
);
}
_Elem *__CLR_OR_THIS_CALL _Gndec()
{
++*
;
return
(--*
);
}
_Elem *__CLR_OR_THIS_CALL _Gninc()
{
--*
;
return
((*
)++);
}
_Elem *__CLR_OR_THIS_CALL _Gnpreinc()
{
--*
;
return
(++(*
));
}
streamsize __CLR_OR_THIS_CALL _Gnavail() const
{
return
(*
!=
nullptr
? *
:
0
);
}
void __CLR_OR_THIS_CALL pbump(int _Off)
{
*
-=
;
*
+=
;
}
void __CLR_OR_THIS_CALL setp(_Elem *_First, _Elem *_Last)
{
*
=
;
*
=
;
*
= (
int
)(
-
);
}
void __CLR_OR_THIS_CALL setp(_Elem *_First, _Elem *_Next, _Elem *_Last)
{
*
=
;
*
=
;
*
= (
int
)(
-
);
}
_Elem *__CLR_OR_THIS_CALL _Pninc()
{
--*
;
return
((*
)++);
}
streamsize __CLR_OR_THIS_CALL _Pnavail() const
{
return
(*
!=
nullptr
? *
:
0
);
}
void __CLR_OR_THIS_CALL _Init()
{
= &
;
= &
;
= &
;
= &
;
= &
;
= &
;
(
nullptr
,
nullptr
);
(
nullptr
,
nullptr
,
nullptr
);
}
void __CLR_OR_THIS_CALL _Init(_Elem **_Gf, _Elem **_Gn, int *_Gc,
**
,
**
,
int
*
)
{
=
;
=
;
=
;
=
;
=
;
=
;
}
virtual int_type __CLR_OR_THIS_CALL overflow(int_type = _Traits::eof())
{
return
(
::eof());
}
virtual int_type __CLR_OR_THIS_CALL pbackfail(int_type = _Traits::eof())
{
return
(
::eof());
}
virtual streamsize __CLR_OR_THIS_CALL showmanyc()
{
return
(
0
);
}
virtual int_type __CLR_OR_THIS_CALL underflow()
{
return
(
::eof());
}
virtual int_type __CLR_OR_THIS_CALL uflow()
{
return
(
::eq_int_type(
::eof(),
())
?
::eof() :
::to_int_type(*
()));
}
virtual streamsize __CLR_OR_THIS_CALL xsgetn(_Elem * _Ptr, streamsize _Count)
{
const
=
;
while
(
0
)
{
=
();
if
(
0
_Size
)
{
if
(
_Size
)
{
_Size
=
;
}
::copy(
,
(),
static_cast
<
>(
_Size
));
+=
_Size
;
-=
_Size
;
(
static_cast
<
int
>(
_Size
));
}
else
{
const
=
();
if
(
::eq_int_type(
::eof(),
_Meta
))
{
break
;
}
*
++ =
::to_char_type(
_Meta
);
--
;
}
}
return
(
_Start_count
-
);
}
virtual streamsize __CLR_OR_THIS_CALL xsputn(const _Elem *_Ptr, streamsize _Count)
{
const
=
;
while
(
0
)
{
=
();
if
(
0
_Size
)
{
if
(
_Size
)
{
_Size
=
;
}
::copy(
(),
,
static_cast
<
>(
_Size
));
+=
_Size
;
-=
_Size
;
(
static_cast
<
int
>(
_Size
));
}
else
if
(
::eq_int_type(
::eof(),
(
::to_int_type(*
))))
{
break
;
}
else
{
++
;
--
;
}
}
return
(
_Start_count
-
);
}
virtual pos_type __CLR_OR_THIS_CALL seekoff(off_type,
::
,
::
=
::
|
::
)
{
return
(
(-
1
));
}
virtual pos_type __CLR_OR_THIS_CALL seekpos(pos_type,
::
=
::
|
::
)
{
return
(
(-
1
));
}
virtual basic_streambuf *__CLR_OR_THIS_CALL setbuf(_Elem *, streamsize)
{
return
(
this
);
}
virtual int __CLR_OR_THIS_CALL sync()
{
return
(
0
);
}
virtual void __CLR_OR_THIS_CALL imbue(const locale&)
{
}
private
:
*
;
*
;
**
;
**
;
*
;
*
;
**
;
**
;
int
;
int
;
int
*
;
int
*
;
protected
:
*
;
};
#if defined(_DLL_CPPLIB)
#if !defined(_CRTBLD) || defined(__FORCE_INSTANCE)
template class _CRTIMP2_PURE_IMPORT basic_streambuf<char, char_traits<char> >;
template
class
__declspec
(dllimport)
<
char
,
<
char
> >;
template class _CRTIMP2_PURE_IMPORT basic_streambuf<wchar_t, char_traits<wchar_t> >;
#endif /* !defined(_CRTBLD) || defined(__FORCE_INSTANCE) */
template
class
__declspec
(dllimport)
<
wchar_t
,
<
wchar_t
> >;
#ifdef __FORCE_INSTANCE
template class _CRTIMP2_PURE_IMPORT basic_streambuf<unsigned short,
char_traits<unsigned short> >;
#endif /* __FORCE_INSTANCE */
#endif /* defined(_DLL_CPPLIB) */
template
<
class
,
class
>
class
{
public
:
using
=
;
using
=
;
using
=
typename
::off_type;
using
=
const
*;
using
=
;
using
=
;
using
=
;
using
=
<
,
>;
using
=
<
,
>;
using
=
typename
::int_type;
constexpr
()
noexcept
: _Strbuf(
nullptr
),
_Got(
true
),
_Val()
{
}
(
*
)
noexcept
: _Strbuf(
),
_Got(
==
nullptr
),
_Val()
{
}
(
&
)
noexcept
: _Strbuf(
.
()),
_Got(
==
nullptr
),
_Val()
{
}
private
:
class
{
public
:
_NODISCARD _Elem operator*() const
{
return
(
);
}
private
:
friend
istreambuf_iterator;
(
*
,
)
: _Strbuf(
),
_Keep(
)
{
}
*
;
;
};
public
:
(
const
&
)
noexcept
: _Strbuf(
.
),
_Got(
==
nullptr
),
_Val()
{
}
_NODISCARD _Elem operator*() const
{
if
(!
)
();
#if _ITERATOR_DEBUG_LEVEL == 2
_STL_VERIFY(_Strbuf != nullptr, "istreambuf_iterator is not dereferencable");
#endif /* _ITERATOR_DEBUG_LEVEL == 2 */
do
{
if
(
!=
nullptr
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\streambuf"
,
565
,
0
,
"%s"
,
"istreambuf_iterator is not dereferencable"
)) || (__debugbreak(),
0
)); ::
(
L"\"istreambuf_iterator is not dereferencable\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\streambuf"
,
565
,
0
); }
while
(
false
); } ; }
while
(
false
);
return
(
);
}
&
()
{
#if _ITERATOR_DEBUG_LEVEL == 2
_STL_VERIFY(_Strbuf != nullptr, "istreambuf_iterator is not incrementable");
#endif /* _ITERATOR_DEBUG_LEVEL == 2 */
do
{
if
(
!=
nullptr
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\streambuf"
,
574
,
0
,
"%s"
,
"istreambuf_iterator is not incrementable"
)) || (__debugbreak(),
0
)); ::
(
L"\"istreambuf_iterator is not incrementable\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\streambuf"
,
574
,
0
); }
while
(
false
); } ; }
while
(
false
);
();
return
(*
this
);
}
(
int
)
{
if
(!
)
();
{
,
};
*
this
;
return
(
_Tmp
);
}
_NODISCARD bool equal(const istreambuf_iterator& _Right) const
{
if
(!
)
();
if
(!
.
)
.
();
return
((
==
nullptr
&&
.
==
nullptr
)
|| (
!=
nullptr
&&
.
!=
nullptr
));
}
private
:
void
()
{
if
(
==
nullptr
||
::eq_int_type(
::eof(),
->
()))
{
=
nullptr
;
=
true
;
}
else
{
=
false
;
}
}
()
const
{
;
if
(
==
nullptr
||
::eq_int_type(
::eof(),
_Meta
=
->
()))
=
nullptr
;
else
=
::to_char_type(
_Meta
);
=
true
;
return
(
);
}
mutable
*
;
mutable
bool
;
mutable
;
};
template
<
class
,
class
>
_NODISCARD inline bool operator==(
const
<
,
>&
,
const
<
,
>&
)
{
return
(
.
(
));
}
template
<
class
,
class
>
_NODISCARD inline bool operator!=(
const
<
,
>&
,
const
<
,
>&
)
{
return
(!(
));
}
template
<
class
,
class
>
class
{
public
:
using
=
;
using
=
void
;
using
=
void
;
using
=
void
;
using
=
void
;
using
=
;
using
=
;
using
=
<
,
>;
using
=
<
,
>;
(
*
)
noexcept
: _Failed(
false
), _Strbuf(
)
{
}
(
&
)
noexcept
: _Failed(
false
), _Strbuf(
.
())
{
}
&
(
)
{
if
(
==
nullptr
||
::eq_int_type(
::eof(),
->
(
)))
=
true
;
return
(*
this
);
}
_NODISCARD ostreambuf_iterator& operator*()
{
return
(*
this
);
}
&
()
{
return
(*
this
);
}
&
(
int
)
{
return
(*
this
);
}
_NODISCARD bool failed() const noexcept
{
return
(
);
}
private
:
bool
;
*
;
};
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma warning(pop)
#pragma pack(pop)
#endif /* RC_INVOKED */
#endif /* _STREAMBUF_ */
#pragma pack(pop)