File Index Symbol Index

// ios standard header
#pragma once
#ifndef _IOS_
#define _IOS_
#ifndef RC_INVOKED #include <xlocnum>
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
// CLASS TEMPLATE basic_ios
template
<
class
_Elem
,
class
_Traits
>
class
basic_ios
:
public
ios_base
{
// base class for basic_istream/basic_ostream
public
:
typedef
basic_ostream
<
_Elem
,
_Traits
>
_Myos
;
typedef
basic_streambuf
<
_Elem
,
_Traits
>
_Mysb
;
typedef
ctype
<
_Elem
>
_Ctype
;
typedef
_Elem
char_type
;
typedef
_Traits
traits_type
;
typedef
typename
_Traits
::int_type
int_type
;
typedef
typename
_Traits
::pos_type
pos_type
;
typedef
typename
_Traits
::off_type
off_type
; {
// construct from stream buffer pointer
init
(
_Strbuf
); } {
// destroy the object
} {
// set state, possibly reraise exception
ios_base
::
clear
(
_Mystrbuf
==
nullptr
? (
_State
|
ios_base
::
badbit
) :
_State
,
_Reraise
); }
#if _HAS_OLD_IOSTREAMS_MEMBERS
{
// set state to _State
clear
((
iostate
)
_State
); }
#endif /* _HAS_OLD_IOSTREAMS_MEMBERS */
{
// merge _State into state, possibly reraise exception
clear
(
rdstate
() |
_State
,
_Reraise
); }
#if _HAS_OLD_IOSTREAMS_MEMBERS
{
// merge _State into state
setstate
((
iostate
)
_State
); }
#endif /* _HAS_OLD_IOSTREAMS_MEMBERS */
{
// copy format parameters
_Tiestr
=
_Right
.
tie
();
_Fillch
=
_Right
.
fill
();
ios_base
::
copyfmt
(
_Right
);
return
(*
this
); } {
// return tie pointer
return
(
_Tiestr
); } {
// set tie pointer
_Myos
*
_Oldtie
=
_Tiestr
;
_Tiestr
=
_Newtie
;
return
(
_Oldtie
); } {
// return stream buffer pointer
return
(
_Mystrbuf
); } {
// set stream buffer pointer
_Mysb
*
_Oldstrbuf
=
_Mystrbuf
;
_Mystrbuf
=
_Strbuf
;
clear
();
return
(
_Oldstrbuf
); } {
// set locale to argument
locale
_Oldlocale
=
ios_base
::
imbue
(
_Loc
);
if
(
rdbuf
() !=
nullptr
)
rdbuf
()->pubimbue(
_Loc
);
return
(
_Oldlocale
); } {
// return fill character
return
(
_Fillch
); } {
// set fill character
_Elem
_Oldfill
=
_Fillch
;
_Fillch
=
_Newfill
;
return
(
_Oldfill
); } {
// convert _Ch to byte using imbued locale
} {
// convert _Byte to character using imbued locale
} {
// assign by moving _Right
{
// different, do the move
_Mystrbuf
=
nullptr
;
_Tiestr
=
nullptr
;
this
->
swap
(
_Right
); } } {
// assign by moving _Right
{
// different, do the move
_Mystrbuf
=
nullptr
;
_Tiestr
=
nullptr
;
this
->
swap
(
_Right
); } } {
// swap all but rdbuf() with right
ios_base
::
swap
(
_Right
); } {
// set stream buffer pointer without changing state
_Mystrbuf
=
_Strbuf
; }
protected
:
bool
_Isstd
=
false
) {
// initialize with stream buffer pointer
_Init
();
// initialize ios_base
_Mystrbuf
=
_Strbuf
;
_Tiestr
=
nullptr
;
_Fillch
=
widen
(
' '
);
if
(
_Mystrbuf
==
nullptr
)
setstate
(
badbit
);
if
(
_Isstd
)
_Addstd
(
this
);
// special handling for standard streams
} {
// default constructor, do nothing
}
private
:
_Mysb
*
_Mystrbuf
;
// pointer to stream buffer
_Myos
*
_Tiestr
;
// pointer to tied output stream
_Elem
_Fillch
;
// the fill character
public
: };
#if defined(_DLL_CPPLIB)
#if !defined(_CRTBLD) || defined(__FORCE_INSTANCE)
char_traits
<
char
> >;
char_traits
<
wchar_t
> >;
#endif /* !defined(_CRTBLD) || defined(__FORCE_INSTANCE) */
#ifdef __FORCE_INSTANCE
template class _CRTIMP2_PURE_IMPORT basic_ios<unsigned short,
char_traits<unsigned short> >;
#endif /* __FORCE_INSTANCE */ #endif /* defined(_DLL_CPPLIB) */
// MANIPULATORS
{
// set boolalpha
_Iosbase
.
setf
(
ios_base
::
boolalpha
);
return
(
_Iosbase
); } {
// set basefield to dec
_Iosbase
.
setf
(
ios_base
::
dec
,
ios_base
::
basefield
);
return
(
_Iosbase
); } {
// clear floatfield
_Iosbase
.
unsetf
(
ios_base
::
floatfield
);
return
(
_Iosbase
); } {
// set floatfield to fixed
_Iosbase
.
setf
(
ios_base
::
fixed
,
ios_base
::
floatfield
);
return
(
_Iosbase
); } {
// set basefield to hex
_Iosbase
.
setf
(
ios_base
::
hex
,
ios_base
::
basefield
);
return
(
_Iosbase
); } {
// set floatfield to hexfloat
_Iosbase
.
setf
(
ios_base
::
hexfloat
,
ios_base
::
floatfield
);
return
(
_Iosbase
); } {
// set adjustfield to internal
_Iosbase
.
setf
(
ios_base
::
internal
,
ios_base
::
adjustfield
);
return
(
_Iosbase
); } {
// set adjustfield to left
_Iosbase
.
setf
(
ios_base
::
left
,
ios_base
::
adjustfield
);
return
(
_Iosbase
); } {
// clear boolalpha
_Iosbase
.
unsetf
(
ios_base
::
boolalpha
);
return
(
_Iosbase
); } {
// clear showbase
_Iosbase
.
unsetf
(
ios_base
::
showbase
);
return
(
_Iosbase
); } {
// clear showpoint
_Iosbase
.
unsetf
(
ios_base
::
showpoint
);
return
(
_Iosbase
); } {
// clear showpos
_Iosbase
.
unsetf
(
ios_base
::
showpos
);
return
(
_Iosbase
); } {
// clear skipws
_Iosbase
.
unsetf
(
ios_base
::
skipws
);
return
(
_Iosbase
); } {
// clear unitbuf
_Iosbase
.
unsetf
(
ios_base
::
unitbuf
);
return
(
_Iosbase
); } {
// clear uppercase
_Iosbase
.
unsetf
(
ios_base
::
uppercase
);
return
(
_Iosbase
); } {
// set oct in basefield
_Iosbase
.
setf
(
ios_base
::
oct
,
ios_base
::
basefield
);
return
(
_Iosbase
); } {
// set right in adjustfield
_Iosbase
.
setf
(
ios_base
::
right
,
ios_base
::
adjustfield
);
return
(
_Iosbase
); } {
// set scientific in floatfield
_Iosbase
.
setf
(
ios_base
::
scientific
,
ios_base
::
floatfield
);
return
(
_Iosbase
); } {
// set showbase
_Iosbase
.
setf
(
ios_base
::
showbase
);
return
(
_Iosbase
); } {
// set showpoint
_Iosbase
.
setf
(
ios_base
::
showpoint
);
return
(
_Iosbase
); } {
// set showpos
_Iosbase
.
setf
(
ios_base
::
showpos
);
return
(
_Iosbase
); } {
// set skipws
_Iosbase
.
setf
(
ios_base
::
skipws
);
return
(
_Iosbase
); } {
// set unitbuf
_Iosbase
.
setf
(
ios_base
::
unitbuf
);
return
(
_Iosbase
); } {
// set uppercase
_Iosbase
.
setf
(
ios_base
::
uppercase
);
return
(
_Iosbase
); }
#if _HAS_TR1_NAMESPACE
}
#endif /* _HAS_TR1_NAMESPACE */
#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 */