File Index Symbol Index

// iosfwd standard header
#pragma once
#ifndef _IOSFWD_
#define _IOSFWD_
#ifndef RC_INVOKED #include <cstdio> #include <cstring>
#include <cwchar>
#include <xstddef>
#include <yvals.h>
#include <crtdbg.h>
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
// STREAM POSITIONING TYPES (from <streambuf>)
using
streamoff
=
long
long
;
using
streamsize
=
long
long
;
// CLASS TEMPLATE fpos (from <streambuf>)
template
<
class
_Statetype
>
class
fpos
{
// store arbitrary file position
public
:
/* implicit */
fpos
(
streamoff
_Off
=
0
) : _Myoff(
_Off
), _Fpos(
0
), _Mystate() {
// construct with stream offset
}
fpos
(
_Statetype
_State
,
fpos_t
_Fileposition
) : _Myoff(
_Fileposition
), _Fpos(
0
), _Mystate(
_State
) {
// construct with conversion state and C file position
} {
// return conversion state
return
(
_Mystate
); }
void
state
(
_Statetype
_State
) {
// set conversion state
_Mystate
=
_State
; }
operator
streamoff
()
const
{
// return offset
// TRANSITION, ABI: We currently always set _Fpos to 0 but older .objs containing old basic_filebuf
// would set _Fpos.
return
(
_Myoff
+
_Fpos
); }
#ifndef _REMOVE_FPOS_SEEKPOS
{
return
{}; }
#endif // _REMOVE_FPOS_SEEKPOS
{
// return difference of file positions as an offset
return
(
static_cast
<
streamoff
>(*
this
) -
static_cast
<
streamoff
>(
_Right
)); }
fpos
&
operator
+
=
(
streamoff
_Off
) {
// add offset
_Myoff
+=
_Off
;
return
(*
this
); }
fpos
&
operator
-
=
(
streamoff
_Off
) {
// subtract offset
_Myoff
-=
_Off
;
return
(*
this
); } {
// return this + offset
fpos
_Tmp
= *
this
;
_Tmp
+
=
_Off
;
return
(
_Tmp
); } {
// return this - offset
fpos
_Tmp
= *
this
;
_Tmp
-
=
_Off
;
return
(
_Tmp
); } {
return
(
static_cast
<
streamoff
>(*
this
)
=
=
static_cast
<
streamoff
>(
_Right
)); }
template
<
class
_Int
,
enable_if_t
<
is_integral_v
<
_Int
>,
int
> =
0
> {
return
(
static_cast
<
streamoff
>(
_Left
) ==
_Right
); }
template
<
class
_Int
,
enable_if_t
<
is_integral_v
<
_Int
>,
int
> =
0
> {
return
(
_Left
==
static_cast
<
streamoff
>(
_Right
)); } {
return
(
static_cast
<
streamoff
>(*
this
)
!
=
static_cast
<
streamoff
>(
_Right
)); }
template
<
class
_Int
,
enable_if_t
<
is_integral_v
<
_Int
>,
int
> =
0
> {
return
(
static_cast
<
streamoff
>(
_Left
) !=
_Right
); }
template
<
class
_Int
,
enable_if_t
<
is_integral_v
<
_Int
>,
int
> =
0
> {
return
(
_Left
!=
static_cast
<
streamoff
>(
_Right
)); }
private
:
streamoff
_Myoff
;
// stream offset
fpos_t
_Fpos
;
// TRANSITION, ABI. C file position, not currently used
_Statetype
_Mystate
;
// current conversion state
};
using
streampos
=
fpos
<
_Mbstatet
>;
using
wstreampos
=
streampos
;
// STRUCT TEMPLATE _Char_traits (FROM <string>)
template
<
class
_Elem
,
class
_Int_type
>
struct
_Char_traits
{
// properties of a string or stream element
using
char_type
=
_Elem
;
using
int_type
=
_Int_type
;
using
pos_type
=
streampos
;
using
off_type
=
streamoff
;
using
state_type
=
_Mbstatet
; {
// compare [_First1, _First1 + _Count) with [_First2, ...)
for
(;
0
<
_Count
; --
_Count
, ++
_First1
, ++
_First2
) {
if
(*
_First1
!= *
_First2
) {
return
(*
_First1
< *
_First2
? -
1
: +
1
); } }
return
(
0
); } {
// find length of null-terminated sequence
size_t
_Count
=
0
;
while
(*
_First
!=
_Elem
()) { ++
_Count
; ++
_First
; }
return
(
_Count
); } {
// copy [_First2, _First2 + _Count) to [_First1, ...)
} {
// copy [_First2, _First2 + _Count) to [_First1, _First1 + _Dest_size)
return
(
copy
(
_First1
,
_First2
,
_Count
)); }
size_t
_Count
,
const
_Elem
&
_Ch
)
noexcept
// strengthened
{
// look for _Ch in [_First, _First + _Count)
for
(;
0
<
_Count
; --
_Count
, ++
_First
) {
if
(*
_First
==
_Ch
) {
return
(
_First
); } }
return
(
nullptr
); } {
// copy [_First2, _First2 + _Count) to [_First1, ...), allowing overlap
}
size_t
_Count
,
const
_Elem
_Ch
)
noexcept
// strengthened
{
// assign _Count * _Ch to [_First, ...)
_Elem
*
_Next
=
_First
;
for
(;
0
<
_Count
; --
_Count
, ++
_Next
) { *
_Next
=
_Ch
; }
return
(
_First
); } {
// assign an element
_Left
=
_Right
; } {
// test for element equality
return
(
_Left
==
_Right
); } {
// test if _Left precedes _Right
return
(
_Left
<
_Right
); } {
// convert metacharacter to character
return
(
static_cast
<
_Elem
>(
_Meta
)); } {
// convert character to metacharacter
return
(
static_cast
<
int_type
>(
_Ch
)); } {
// test for metacharacter equality
return
(
_Left
==
_Right
); } {
// return anything but EOF
return
(
_Meta
!=
eof
() ?
_Meta
: !
eof
()); } {
// return end-of-file metacharacter
} };
// STRUCT TEMPLATE _WChar_traits
template
<
class
_Elem
>
struct
_WChar_traits
{
// char_traits for the char16_t-likes: char16_t, wchar_t, unsigned short
using
char_type
=
_Elem
;
using
int_type
=
unsigned
short
;
using
pos_type
=
streampos
;
using
off_type
=
streamoff
;
using
state_type
=
_Mbstatet
; {
// compare [_First1, _First1 + _Count) with [_First2, ...)
#if _HAS_CXX17
if constexpr (is_same_v<_Elem, wchar_t>)
{
return (__builtin_wmemcmp(_First1, _First2, _Count));
}
else
{
return (_Char_traits<_Elem, unsigned short>::compare(_First1, _First2, _Count));
} #else /* _HAS_CXX17 */
reinterpret_cast
<
const
wchar_t
*>(
_First2
),
_Count
));
#endif /* _HAS_CXX17 */
} {
// find length of null-terminated sequence
#if _HAS_CXX17
if constexpr (is_same_v<_Elem, wchar_t>)
{
return (__builtin_wcslen(_First));
}
else
{
return (_Char_traits<_Elem, unsigned short>::length(_First));
} #else /* _HAS_CXX17 */
} {
// copy [_First2, _First2 + _Count) to [_First1, ...)
reinterpret_cast
<
const
wchar_t
*>(
_First2
),
_Count
))); } {
// copy [_First2, _First2 + _Count) to [_First1, ...)
return
(
copy
(
_First1
,
_First2
,
_Count
)); }
const
size_t
_Count
,
const
_Elem
&
_Ch
)
noexcept
// strengthened
{
// look for _Ch in [_First, _First + _Count)
#if _HAS_CXX17
if constexpr (is_same_v<_Elem, wchar_t>)
{
return (__builtin_wmemchr(_First, _Ch, _Count));
}
else
{
return (_Char_traits<_Elem, unsigned short>::find(_First, _Count, _Ch));
} #else /* _HAS_CXX17 */
reinterpret_cast
<
const
wchar_t
*>(
_First
),
_Ch
,
_Count
)));
#endif /* _HAS_CXX17 */
} {
// copy [_First2, _First2 + _Count) to [_First1, ...)
reinterpret_cast
<
const
wchar_t
*>(
_First2
),
_Count
))); }
noexcept
// strengthened
{
// assign _Count * _Ch to [_First, ...)
} {
// assign an element
_Left
=
_Right
; } {
// test for element equality
return
(
_Left
==
_Right
); } {
// test if _Left precedes _Right
return
(
_Left
<
_Right
); } {
// convert metacharacter to character
return
(
_Meta
); } {
// convert character to metacharacter
return
(
_Ch
); } {
// test for metacharacter equality
return
(
_Left
=
=
_Right
); } {
// return anything but EOF
return
(
_Meta
!
=
eof
() ?
_Meta
:
static_cast
<
int_type
>(!
eof
())); } {
// return end-of-file metacharacter
} };
// STRUCT TEMPLATE char_traits
template
<
class
_Elem
>
struct
char_traits
:
_Char_traits
<
_Elem
,
long
> {
// properties of a string or stream unknown element
};
// STRUCT char_traits<char16_t>
template
<>
struct
char_traits
<
char16_t
> :
_WChar_traits
<
char16_t
> {
// properties of a string or stream char16_t element
};
using
u16streampos
=
streampos
;
// STRUCT char_traits<char32_t>
template
<>
struct
char_traits
<
char32_t
> :
_Char_traits
<
char32_t
,
unsigned
int
> {
// properties of a string or stream char32_t element
};
using
u32streampos
=
streampos
;
// STRUCT char_traits<wchar_t>
template
<>
struct
char_traits
<
wchar_t
> :
_WChar_traits
<
wchar_t
> {
// properties of a string or stream wchar_t element
};
#ifdef _NATIVE_WCHAR_T_DEFINED
// STRUCT char_traits<unsigned short>
template
<>
struct
char_traits
<
unsigned
short
> :
_WChar_traits
<
unsigned
short
> {
// properties of a string or stream unsigned short element
};
#endif /* _NATIVE_WCHAR_T_DEFINED */
// STRUCT char_traits<char> (FROM <string>)
template
<>
struct
char_traits
<
char
> {
// properties of a string or stream char element
using
char_type
=
char
;
using
int_type
=
int
;
using
pos_type
=
streampos
;
using
off_type
=
streamoff
;
using
state_type
=
_Mbstatet
; {
// compare [_First1, _First1 + _Count) with [_First2, ...)
#if _HAS_CXX17
return (__builtin_memcmp(_First1, _First2, _Count)); #else /* _HAS_CXX17 */
} {
// find length of null-terminated string
#if _HAS_CXX17
return (__builtin_strlen(_First)); #else /* _HAS_CXX17 */
} {
// copy [_First2, _First2 + _Count) to [_First1, ...)
} {
// copy [_First2, _First2 + _Count) to [_First1, ...)
return
(
copy
(
_First1
,
_First2
,
_Count
)); }
const
size_t
_Count
,
const
char
&
_Ch
)
noexcept
// strengthened
{
// look for _Ch in [_First, _First + _Count)
#if _HAS_CXX17
return (__builtin_char_memchr(_First, _Ch, _Count)); #else /* _HAS_CXX17 */
} {
// copy [_First2, _First2 + _Count) to [_First1, ...)
}
const
size_t
_Count
,
const
char
_Ch
)
noexcept
// strengthened
{
// assign _Count * _Ch to [_First, ...)
} {
// assign an element
_Left
=
_Right
; } {
// test for element equality
return
(
_Left
=
=
_Right
); } {
// test if _Left precedes _Right
return
(
static_cast
<
unsigned
char
>(
_Left
)
<
static_cast
<
unsigned
char
>(
_Right
)); } {
// convert metacharacter to character
return
(
static_cast
<
char
>(
_Meta
)); } {
// convert character to metacharacter
return
(
static_cast
<
unsigned
char
>(
_Ch
)); } {
// test for metacharacter equality
return
(
_Left
=
=
_Right
); } {
// return anything but EOF
return
(
_Meta
!
=
eof
() ?
_Meta
: !
eof
()); } {
// return end-of-file metacharacter
} };
// FORWARD REFERENCES
template
<
class
_Ty
>
class
allocator
;
class
ios_base
;
template
<
class
_Elem
,
class
_Traits
=
char_traits
<
_Elem
>>
class
basic_ios
;
template
<
class
_Elem
,
class
_Traits
=
char_traits
<
_Elem
>>
class
istreambuf_iterator
;
template
<
class
_Elem
,
class
_Traits
=
char_traits
<
_Elem
>>
class
ostreambuf_iterator
;
template
<
class
_Elem
,
class
_Traits
=
char_traits
<
_Elem
>>
class
basic_streambuf
;
template
<
class
_Elem
,
class
_Traits
=
char_traits
<
_Elem
>>
class
basic_istream
;
template
<
class
_Elem
,
class
_Traits
=
char_traits
<
_Elem
>>
class
basic_ostream
;
template
<
class
_Elem
,
class
_Traits
=
char_traits
<
_Elem
>>
class
basic_iostream
;
template
<
class
_Elem
,
class
_Traits
=
char_traits
<
_Elem
>,
class
_Alloc
=
allocator
<
_Elem
>>
class
basic_stringbuf
;
template
<
class
_Elem
,
class
_Traits
=
char_traits
<
_Elem
>,
class
_Alloc
=
allocator
<
_Elem
>>
class
basic_istringstream
;
template
<
class
_Elem
,
class
_Traits
=
char_traits
<
_Elem
>,
class
_Alloc
=
allocator
<
_Elem
>>
class
basic_ostringstream
;
template
<
class
_Elem
,
class
_Traits
=
char_traits
<
_Elem
>,
class
_Alloc
=
allocator
<
_Elem
>>
class
basic_stringstream
;
template
<
class
_Elem
,
class
_Traits
=
char_traits
<
_Elem
>>
class
basic_filebuf
;
template
<
class
_Elem
,
class
_Traits
=
char_traits
<
_Elem
>>
class
basic_ifstream
;
template
<
class
_Elem
,
class
_Traits
=
char_traits
<
_Elem
>>
class
basic_ofstream
;
template
<
class
_Elem
,
class
_Traits
=
char_traits
<
_Elem
>>
class
basic_fstream
;
#if defined(_DLL_CPPLIB)
template
<
class
_Elem
,
class
_InIt
>
class
num_get
;
template
<
class
_Elem
,
class
_OutIt
>
class
num_put
;
template
<
class
_Elem
>
class
collate
;
#endif /* defined(_DLL_CPPLIB) */
// char TYPEDEFS
using
ios
=
basic_ios
<
char
,
char_traits
<
char
>>;
using
streambuf
=
basic_streambuf
<
char
,
char_traits
<
char
>>;
using
istream
=
basic_istream
<
char
,
char_traits
<
char
>>;
using
ostream
=
basic_ostream
<
char
,
char_traits
<
char
>>;
using
iostream
=
basic_iostream
<
char
,
char_traits
<
char
>>;
using
stringbuf
=
basic_stringbuf
<
char
,
char_traits
<
char
>,
allocator
<
char
>>;
using
istringstream
=
basic_istringstream
<
char
,
char_traits
<
char
>,
allocator
<
char
>>;
using
ostringstream
=
basic_ostringstream
<
char
,
char_traits
<
char
>,
allocator
<
char
>>;
using
stringstream
=
basic_stringstream
<
char
,
char_traits
<
char
>,
allocator
<
char
>>;
using
filebuf
=
basic_filebuf
<
char
,
char_traits
<
char
>>;
using
ifstream
=
basic_ifstream
<
char
,
char_traits
<
char
>>;
using
ofstream
=
basic_ofstream
<
char
,
char_traits
<
char
>>;
using
fstream
=
basic_fstream
<
char
,
char_traits
<
char
>>;
// wchar_t TYPEDEFS
using
wios
=
basic_ios
<
wchar_t
,
char_traits
<
wchar_t
>>;
using
wstreambuf
=
basic_streambuf
<
wchar_t
,
char_traits
<
wchar_t
>>;
using
wistream
=
basic_istream
<
wchar_t
,
char_traits
<
wchar_t
>>;
using
wostream
=
basic_ostream
<
wchar_t
,
char_traits
<
wchar_t
>>;
using
wiostream
=
basic_iostream
<
wchar_t
,
char_traits
<
wchar_t
>>;
using
wstringbuf
=
basic_stringbuf
<
wchar_t
,
char_traits
<
wchar_t
>,
allocator
<
wchar_t
>>;
using
wistringstream
=
basic_istringstream
<
wchar_t
,
char_traits
<
wchar_t
>,
allocator
<
wchar_t
>>;
using
wostringstream
=
basic_ostringstream
<
wchar_t
,
char_traits
<
wchar_t
>,
allocator
<
wchar_t
>>;
using
wstringstream
=
basic_stringstream
<
wchar_t
,
char_traits
<
wchar_t
>,
allocator
<
wchar_t
>>;
using
wfilebuf
=
basic_filebuf
<
wchar_t
,
char_traits
<
wchar_t
>>;
using
wifstream
=
basic_ifstream
<
wchar_t
,
char_traits
<
wchar_t
>>;
using
wofstream
=
basic_ofstream
<
wchar_t
,
char_traits
<
wchar_t
>>;
using
wfstream
=
basic_fstream
<
wchar_t
,
char_traits
<
wchar_t
>>;
#if defined(_CRTBLD)
// unsigned short TYPEDEFS
using ushistream = basic_istream<unsigned short, char_traits<unsigned short>>;
using ushostream = basic_ostream<unsigned short, char_traits<unsigned short>>;
using ushfilebuf = basic_filebuf<unsigned short, char_traits<unsigned short>>; #endif /* defined(_CRTBLD) */
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
/* * Copyright (c) by P.J. Plauger. All rights reserved. * Consult your license regarding permissions and restrictions. V6.50:0009 */