#pragma once
#ifndef _XIOSBASE_
#define _XIOSBASE_
#ifndef RC_INVOKED
#include <xlocale>
#include <system_error>
#include <share.h>
#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
#define _OPENPROT _SH_DENYNO
#define _IOSskipws 0x0001
#define _IOSunitbuf 0x0002
#define _IOSuppercase 0x0004
#define _IOSshowbase 0x0008
#define _IOSshowpoint 0x0010
#define _IOSshowpos 0x0020
#define _IOSleft 0x0040
#define _IOSright 0x0080
#define _IOSinternal 0x0100
#define _IOSdec 0x0200
#define _IOSoct 0x0400
#define _IOShex 0x0800
#define _IOSscientific 0x1000
#define _IOSfixed 0x2000
#define _IOShexfloat 0x3000 // added with TR1
#define _IOSboolalpha 0x4000
#define _IOS_Stdio 0x8000
#define _IOS_Nocreate 0x40
#define _IOS_Noreplace 0x80
#define _IOSbinary 0x20
template
<
class
>
class
{
public
:
enum
{
=
1
};
enum
{
=
0xffff
,
=
0
};
static constexpr _Fmtflags skipws = (_Fmtflags)_IOSskipws;
static
constexpr
= (
)
0x0001
;
static constexpr _Fmtflags unitbuf = (_Fmtflags)_IOSunitbuf;
static
constexpr
= (
)
0x0002
;
static constexpr _Fmtflags uppercase = (_Fmtflags)_IOSuppercase;
static
constexpr
= (
)
0x0004
;
static constexpr _Fmtflags showbase = (_Fmtflags)_IOSshowbase;
static
constexpr
= (
)
0x0008
;
static constexpr _Fmtflags showpoint = (_Fmtflags)_IOSshowpoint;
static
constexpr
= (
)
0x0010
;
static constexpr _Fmtflags showpos = (_Fmtflags)_IOSshowpos;
static
constexpr
= (
)
0x0020
;
static constexpr _Fmtflags left = (_Fmtflags)_IOSleft;
static
constexpr
= (
)
0x0040
;
static constexpr _Fmtflags right = (_Fmtflags)_IOSright;
static
constexpr
= (
)
0x0080
;
static constexpr _Fmtflags internal = (_Fmtflags)_IOSinternal;
static
constexpr
= (
)
0x0100
;
static constexpr _Fmtflags dec = (_Fmtflags)_IOSdec;
static
constexpr
= (
)
0x0200
;
static constexpr _Fmtflags oct = (_Fmtflags)_IOSoct;
static
constexpr
= (
)
0x0400
;
static constexpr _Fmtflags hex = (_Fmtflags)_IOShex;
static
constexpr
= (
)
0x0800
;
static constexpr _Fmtflags scientific = (_Fmtflags)_IOSscientific;
static
constexpr
= (
)
0x1000
;
static constexpr _Fmtflags fixed = (_Fmtflags)_IOSfixed;
static
constexpr
= (
)
0x2000
;
static
constexpr
=
(_Fmtflags)_IOShexfloat; // added with TR1 (not in C++11)
static constexpr _Fmtflags boolalpha = (_Fmtflags)_IOSboolalpha;
static
constexpr
= (
)
0x4000
;
static constexpr _Fmtflags _Stdio = (_Fmtflags)_IOS_Stdio;
static
constexpr
= (
)
0x8000
;
static constexpr _Fmtflags adjustfield = (_Fmtflags)(_IOSleft
static
constexpr
= (
)(
0x0040
| _IOSright | _IOSinternal);
static constexpr _Fmtflags basefield = (_Fmtflags)(_IOSdec
static
constexpr
= (
)(
0x0200
static constexpr _Fmtflags floatfield = (_Fmtflags)(_IOSscientific
static
constexpr
= (
)(
0x1000
enum
{
=
0x17
};
static
constexpr
= (
)
0x0
;
static
constexpr
= (
)
0x1
;
static
constexpr
= (
)
0x2
;
static
constexpr
= (
)
0x4
;
enum
{
=
0xff
};
static
constexpr
= (
)
0x01
;
static
constexpr
= (
)
0x02
;
static
constexpr
= (
)
0x04
;
static
constexpr
= (
)
0x08
;
static
constexpr
= (
)
0x10
;
static constexpr _Openmode _Nocreate = (_Openmode)_IOS_Nocreate;
static
constexpr
= (
)
0x40
;
static constexpr _Openmode _Noreplace = (_Openmode)_IOS_Noreplace;
static
constexpr
= (
)
0x80
;
static constexpr _Openmode binary = (_Openmode)_IOSbinary;
static
constexpr
= (
)
0x20
;
enum
{
,
,
};
static
constexpr
=
;
static
constexpr
=
;
static
constexpr
=
;
enum
{
};
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
template
<
class
>
const
typename
<
>::
<
>::
;
class _CRTIMP2_PURE_IMPORT ios_base
class
__declspec
(dllimport)
:
public
<
int
>
{
public
:
typedef
int
;
typedef
int
;
typedef
int
;
typedef
int
;
#if _HAS_OLD_IOSTREAMS_MEMBERS
typedef _STD streamoff streamoff;
typedef _STD streampos streampos;
#endif /* _HAS_OLD_IOSTREAMS_MEMBERS */
enum
{
,
,
};
typedef void (__CLRCALL_OR_CDECL *event_callback)(event, ios_base&, int);
typedef
void
(
__cdecl
*
)(
,
&,
int
);
#if _HAS_OLD_IOSTREAMS_MEMBERS
typedef
unsigned
int
,
,
;
#endif /* _HAS_OLD_IOSTREAMS_MEMBERS */
class
:
public
{
public
:
explicit
(
const
&
,
const
&
=
(
::
))
:
(
,
)
{
}
explicit
(
const
char
*
,
const
&
=
(
::
))
:
(
,
)
{
}
#if _HAS_EXCEPTIONS
#else /* _HAS_EXCEPTIONS */
protected:
virtual void _Doraise() const
{ // report the exception
_RAISE(*this);
}
#endif /* _HAS_EXCEPTIONS */
};
class _CRTIMP2_PURE_IMPORT Init
class
__declspec
(dllimport)
{
public
:
__CLR_OR_THIS_CALL Init()
{
(
this
);
}
__CLR_OR_THIS_CALL ~Init() noexcept
{
(
this
);
}
private
:
static _MRTIMP2_NPURE void __cdecl _Init_ctor(Init *);
static
void
__cdecl
(
*);
static _MRTIMP2_NPURE void __cdecl _Init_dtor(Init *);
static
void
__cdecl
(
*);
__PURE_APPDOMAIN_GLOBAL static int _Init_cnt; // net ctor count
static _MRTIMP2_NPURE int& __cdecl _Init_cnt_func();
};
explicit __CLR_OR_THIS_CALL operator bool() const
{
return
(!
());
}
_NODISCARD bool __CLR_OR_THIS_CALL operator!() const
{
return
(
());
}
void __CLR_OR_THIS_CALL clear(iostate _State, bool _Reraise)
{
&=
;
=
;
const
auto
=
&
;
if
(
_Filtered
)
{
if
(
)
{
}
const
char
*
;
if
(
_Filtered
&
::
)
{
_Msg
=
"ios_base::badbit set"
;
}
else
if
(
_Filtered
&
::
)
{
_Msg
=
"ios_base::failbit set"
;
}
else
{
_Msg
=
"ios_base::eofbit set"
;
}
}
}
void __CLR_OR_THIS_CALL clear(iostate _State = goodbit)
{
(
,
false
);
}
#if _HAS_OLD_IOSTREAMS_MEMBERS
void __CLR_OR_THIS_CALL clear(io_state _State)
{
((
)
);
}
#endif /* _HAS_OLD_IOSTREAMS_MEMBERS */
_NODISCARD iostate __CLR_OR_THIS_CALL rdstate() const
{
return
(
);
}
void __CLR_OR_THIS_CALL setstate(iostate _State, bool _Exreraise)
{
(
() |
,
);
}
void __CLR_OR_THIS_CALL setstate(iostate _State)
{
(
() |
,
false
);
}
#if _HAS_OLD_IOSTREAMS_MEMBERS
void __CLR_OR_THIS_CALL setstate(io_state _State)
{
((
)
);
}
#endif /* _HAS_OLD_IOSTREAMS_MEMBERS */
_NODISCARD bool __CLR_OR_THIS_CALL good() const
{
return
(
()
::
);
}
_NODISCARD bool __CLR_OR_THIS_CALL eof() const
{
return
(
() &
::
);
}
_NODISCARD bool __CLR_OR_THIS_CALL fail() const
{
return
(
() & (
::
|
::
));
}
_NODISCARD bool __CLR_OR_THIS_CALL bad() const
{
return
(
() &
::
);
}
_NODISCARD iostate __CLR_OR_THIS_CALL exceptions() const
{
return
(
);
}
void __CLR_OR_THIS_CALL exceptions(iostate _Newexcept)
{
=
&
;
(
());
}
#if _HAS_OLD_IOSTREAMS_MEMBERS
void __CLR_OR_THIS_CALL exceptions(io_state _State)
{
((
)
);
}
#endif /* _HAS_OLD_IOSTREAMS_MEMBERS */
_NODISCARD fmtflags __CLR_OR_THIS_CALL flags() const
{
return
(
);
}
fmtflags __CLR_OR_THIS_CALL flags(fmtflags _Newfmtflags)
{
const
=
;
=
&
;
return
(
_Oldfmtflags
);
}
fmtflags __CLR_OR_THIS_CALL setf(fmtflags _Newfmtflags)
{
const
::
=
;
|=
&
;
return
(
_Oldfmtflags
);
}
fmtflags __CLR_OR_THIS_CALL setf(fmtflags _Newfmtflags, fmtflags _Mask)
{
const
::
=
;
= (
_Oldfmtflags
& ~
) | (
&
&
);
return
(
_Oldfmtflags
);
}
void __CLR_OR_THIS_CALL unsetf(fmtflags _Mask)
{
&= ~
;
}
_NODISCARD streamsize __CLR_OR_THIS_CALL precision() const
{
return
(
);
}
streamsize __CLR_OR_THIS_CALL precision(streamsize _Newprecision)
{
const
=
;
=
;
return
(
_Oldprecision
);
}
_NODISCARD streamsize __CLR_OR_THIS_CALL width() const
{
return
(
);
}
streamsize __CLR_OR_THIS_CALL width(streamsize _Newwidth)
{
const
=
;
=
;
return
(
_Oldwidth
);
}
_NODISCARD locale __CLR_OR_THIS_CALL getloc() const
{
return
(*
);
}
locale __CLR_OR_THIS_CALL imbue(const locale& _Loc)
{
= *
;
*
;
(
);
return
(
_Oldlocale
);
}
_NODISCARD static int __CLRCALL_OR_CDECL xalloc()
{
_BEGIN_LOCK(_LOCK_STREAM) // lock thread to ensure atomicity
return
(
++);
}
_NODISCARD long& __CLR_OR_THIS_CALL iword(int _Idx)
{
return
(
(
).
);
}
_NODISCARD void *& __CLR_OR_THIS_CALL pword(int _Idx)
{
return
(
(
).
);
}
void __CLR_OR_THIS_CALL register_callback(event_callback _Pfn,
int
)
{
=
new
(
,
,
);
}
ios_base& __CLR_OR_THIS_CALL copyfmt(const ios_base& _Other)
{
if (this != _STD addressof(_Other))
{
();
*
*
.
;
=
.
;
=
.
;
=
.
;
*
=
.
;
for
(
=
nullptr
;
_Ptr
!=
nullptr
;
_Ptr
=
_Ptr
->
)
if
(
_Ptr
->
0
||
_Ptr
->
!=
nullptr
)
{
(
_Ptr
->
) =
_Ptr
->
;
(
_Ptr
->
) =
_Ptr
->
;
}
for
(
*
=
.
;
_Pfa
!=
nullptr
;
_Pfa
=
_Pfa
->
)
(
_Pfa
->
,
_Pfa
->
);
(
);
(
.
);
}
return
(*
this
);
}
static bool __CLRCALL_OR_CDECL sync_with_stdio(bool _Newsync = true)
static
bool
__cdecl
(
bool
=
true
)
{
_BEGIN_LOCK(_LOCK_STREAM) // lock thread to ensure atomicity
const
bool
=
;
=
;
return
(
_Oldsync
);
}
void __CLR_OR_THIS_CALL swap(ios_base& _Right)
{
if (this != _STD addressof(_Right))
{
_STD swap(_Mystate, _Right._Mystate);
_STD swap(_Except, _Right._Except);
_STD swap(_Fmtfl, _Right._Fmtfl);
_STD swap(_Prec, _Right._Prec);
_STD swap(_Wide, _Right._Wide);
_STD swap(_Arr, _Right._Arr);
_STD swap(_Calls, _Right._Calls);
_STD swap(_Ploc, _Right._Ploc);
}
}
virtual __CLR_OR_THIS_CALL ~ios_base() noexcept // destroy the object
{
(
this
);
}
static _MRTIMP2_PURE_NPURE void __CLRCALL_PURE_OR_CDECL
(
*);
;
protected
:
__CLR_OR_THIS_CALL ios_base()
{
}
void __CLR_OR_THIS_CALL _Init()
{
=
nullptr
;
=
0
;
=
;
= (
)(
|
);
=
6
;
=
0
;
=
nullptr
;
=
nullptr
;
(
);
=
new
;
}
private
:
struct
:
public
{
public
:
__CLR_OR_THIS_CALL _Iosarray(int _Idx, _Iosarray *_Link)
: _Next(
), _Index(
), _Lo(
0
), _Vp(
nullptr
)
{
}
*
;
int
;
long
;
void
*
;
};
struct
:
public
{
__CLR_OR_THIS_CALL _Fnarray(int _Idx, event_callback _Pnew, _Fnarray *_Link)
: _Next(
), _Index(
), _Pfn(
)
{
}
*
;
int
;
;
};
void __CLR_OR_THIS_CALL _Callfns(event _Ev)
{
for
(
*
=
;
_Pfa
!=
nullptr
;
_Pfa
=
_Pfa
->
)
(*
_Pfa
->
)(
, *
this
,
_Pfa
->
);
}
_Iosarray& __CLR_OR_THIS_CALL _Findarr(int _Idx)
{
*
, *
;
for
(
_Ptr1
=
,
_Ptr2
=
nullptr
;
_Ptr1
!=
nullptr
;
_Ptr1
=
_Ptr1
->
)
if
(
_Ptr1
->
)
return
(*
_Ptr1
);
else
if
(
_Ptr2
==
nullptr
&&
_Ptr1
->
==
0
&&
_Ptr1
->
==
nullptr
)
_Ptr2
=
_Ptr1
;
if
(
_Ptr2
!=
nullptr
)
{
_Ptr2
->
=
;
return
(*
_Ptr2
);
}
=
new
(
,
);
return
(*
);
}
void __CLR_OR_THIS_CALL _Tidy()
{
(
);
*
, *
;
for
(
_Ptr1
=
;
_Ptr1
!=
nullptr
;
_Ptr1
=
_Ptr2
)
{
_Ptr2
=
_Ptr1
->
;
delete
_Ptr1
;
}
=
nullptr
;
*
, *
;
for
(
_Pfa1
=
;
_Pfa1
!=
nullptr
;
_Pfa1
=
_Pfa2
)
{
_Pfa2
=
_Pfa1
->
;
delete
_Pfa1
;
}
=
nullptr
;
}
;
;
;
;
;
*
;
*
;
*
;
__PURE_APPDOMAIN_GLOBAL static int _Index;
__PURE_APPDOMAIN_GLOBAL static bool _Sync;
static _MRTIMP2_PURE_NPURE void __CLRCALL_PURE_OR_CDECL
(
*);
public
:
(
const
&) =
delete
;
&
(
const
&) =
delete
;
};
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma warning(pop)
#pragma pack(pop)
#endif /* RC_INVOKED */
#endif /* _XIOSBASE_ */
#pragma pack(pop)