class
<fstream>

std::wfstream

typedef basic_fstream<wchar_t> wfstream;
File stream (wide)

Input/output stream class to operate on files using wide characters.

This is an instantiation of basic_fstream with the following template parameters:
template parameterdefinitioncomments
charTwchar_tAliased as member char_type
traitschar_traits<wchar_t>Aliased as member traits_type

Apart from the internal file buffer of type wfilebuf , objects of this class keep a set of internal fields inherited from ios_base , wios and wistream :

fieldmember functionsdescription
Formattingformat flagsflags
setf
unsetf
A set of internal flags that affect how certain input/output operations are interpreted or generated.
See member type fmtflags .
field widthwidth Width of the next formatted element to insert.
display precisionprecision Decimal precision for the next floating-point value inserted.
localegetloc
imbue
The locale object used by the function for formatted input/output operations affected by localization properties.
fill characterfill Character to pad a formatted field up to the field width (width ).
Stateerror staterdstate
setstate
clear
The current error state of the stream.
Individual values may be obtained by calling good , eof , fail and bad .
See member type iostate .
exception maskexceptions The state flags for which a failure exception is thrown.
See member type iostate .
Othercallback stackregister_callback Stack of pointers to functions that are called when certain events occur.
extensible arraysiword
pword
xalloc
Internal arrays to store objects of type long and void*.
tied streamtie Pointer to output stream that is flushed before each i/o operation on this stream.
stream bufferrdbuf Pointer to the associated basic_streambuf object, which is charge of all input/output operations.
character countgcount Count of characters read by last unformatted input operation (input streams only).

Member types

The class declares the following member types:
member typedefinition
char_typewchar_t
traits_typechar_traits<wchar_t>
int_typewint_t
pos_typewstreampos
off_typestreamoff
And these member types inherited from ios_base , wistream and wostream :
event
Type to indicate event type (public member type)
event_callback
Event callback function type (public member type)
failure
Base class for stream exceptions (public member class)
fmtflags
Type for stream format flags (public member type)
Init
Initialize standard stream objects (public member class)
iostate
Type for stream state flags (public member type)
openmode
Type for stream opening mode flags (public member type)
seekdir
Type for stream seeking direction flag (public member type)
sentry (wistream)
Prepare stream for input (public member class)
sentry (wostream)
Prepare stream for output (public member class)

Public member functions

Note: This section links to the references for members of its basic template (basic_fstream ).

(constructor)
Construct object and optionally open file (public member function)
open
Open file (public member function)
is_open
Check if a file is open (public member function)
close
Close file (public member function)
rdbuf
Get the associated filebuf object (public member function)
operator=
Move assignment (public member function)
swap
Swap internals (public member function)

Public member functions inherited from wistream

>/">operator>>
Extract formatted input (public member function)
gcount
Get character count (public member function)
get
Get characters (public member function)
getline
Get line (public member function)
ignore
Extract and discard characters (public member function)
peek
Peek next character (public member function)
read
Read block of data (public member function)
readsome
Read data available in buffer (public member function)
putback
Put character back (public member function)
unget
Unget character (public member function)
tellg
Get position in input sequence (public member function)
seekg
Set position in input sequence (public member function)
sync
Synchronize input buffer (public member function)

Public member functions inherited from wostream

operator<<
Insert formatted output (public member function)
put
Put character (public member function)
write
Write block of data (public member function)
tellp
Get position in output sequence (public member function)
seekp
Set position in output sequence (public member function)
flush
Flush output stream buffer (public member function)

Public member functions inherited from wios

good
Check whether state of stream is good (public member function)
eof
Check whether eofbit is set (public member function)
fail
Check whether failbit or badbit is set (public member function)
bad
Check whether badbit is set (public member function)
operator!
Evaluate stream (not) (public member function)
operator bool
Evaluate stream (public member function)
rdstate
Get error state flags (public member function)
setstate
Set error state flag (public member function)
clear
Set error state flags (public member function)
copyfmt
Copy formatting information (public member function)
fill
Get/set fill character (public member function)
exceptions
Get/set exceptions mask (public member function)
imbue
Imbue locale (public member function)
tie
Get/set tied stream (public member function)
rdbuf
Get/set stream buffer (public member function)
narrow
Narrow character (public member function)
widen
Widen character (public member function)

Public member functions inherited from ios_base

flags
Get/set format flags (public member function)
setf
Set specific format flags (public member function)
unsetf
Clear specific format flags (public member function)
precision
Get/Set floating-point decimal precision (public member function)
width
Get/set field width (public member function)
imbue
Imbue locale (public member function)
getloc
Get current locale (public member function)
xalloc
Get new index for extensible array [static] (public static member function)
iword
Get integer element of extensible array (public member function)
pword
Get pointer element of extensible array (public member function)
register_callback
Register event callback function (public member function)
sync_with_stdio
Toggle synchronization with cstdio streams [static] (public static member function)

Non-member function overloads

swap
Swap file streams (function template)

AltStyle によって変換されたページ (->オリジナル) /