STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Macros | Functions
fstream File Reference
#include <istream>

Classes

class  basic_filebuf< _Elem, _Traits >
 
class  basic_ifstream< _Elem, _Traits >
 
class  basic_ofstream< _Elem, _Traits >
 
class  basic_fstream< _Elem, _Traits >
 

Macros

#define _FSTREAM_
 
#define _IORCNT   _IOCNT /* read and write counts are the same */
 
#define _IOWCNT   _IOCNT
 

Functions

_STD_BEGIN _CRTIMP2_PURE _Filet *__CLRCALL_PURE_OR_CDECL _Fiopen (const char *, ios_base::openmode, int)
 
_CRTIMP2_PURE _Filet *__CLRCALL_PURE_OR_CDECL _Fiopen (const wchar_t *, ios_base::openmode, int)
 
template<class _Elem >
bool _Fgetc (_Elem &_Ch, _Filet *_File)
 
template<>
bool _Fgetc (char &_Byte, _Filet *_File)
 
template<>
bool _Fgetc (wchar_t &_Wchar, _Filet *_File)
 
template<class _Elem >
bool _Fputc (_Elem _Ch, _Filet *_File)
 
template<>
bool _Fputc (char _Byte, _Filet *_File)
 
template<>
bool _Fputc (wchar_t _Wchar, _Filet *_File)
 
template<class _Elem >
bool _Ungetc (const _Elem &_Ch, _Filet *_File)
 
template<>
bool _Ungetc (const char &_Byte, _Filet *_File)
 
template<>
bool _Ungetc (const signed char &_Byte, _Filet *_File)
 
template<>
bool _Ungetc (const unsigned char &_Byte, _Filet *_File)
 
template<>
bool _Ungetc (const wchar_t &_Wchar, _Filet *_File)
 
template<class _Elem , class _Traits >
void swap (basic_filebuf< _Elem, _Traits > &_Left, basic_filebuf< _Elem, _Traits > &_Right)
 
template<class _Elem , class _Traits >
void swap (basic_ifstream< _Elem, _Traits > &_Left, basic_ifstream< _Elem, _Traits > &_Right)
 
template<class _Elem , class _Traits >
void swap (basic_ofstream< _Elem, _Traits > &_Left, basic_ofstream< _Elem, _Traits > &_Right)
 
template<class _Elem , class _Traits >
void swap (basic_fstream< _Elem, _Traits > &_Left, basic_fstream< _Elem, _Traits > &_Right)
 

Macro Definition Documentation

#define _FSTREAM_
#define _IORCNT   _IOCNT /* read and write counts are the same */
#define _IOWCNT   _IOCNT

Function Documentation

template<class _Elem >
bool _Fgetc ( _Elem &  _Ch,
_Filet _File 
)
inline
32  { // get an element from a C stream
33  return (fread(&_Ch, sizeof (_Elem), 1, _File) == 1);
34  }
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Check_return_opt_ _ACRTIMP size_t __cdecl fread(_Out_writes_bytes_(_ElementSize *_ElementCount) void *_Buffer, _In_ size_t _ElementSize, _In_ size_t _ElementCount, _Inout_ FILE *_Stream)
template<>
bool _Fgetc ( char _Byte,
_Filet _File 
)
inline
37  { // get a char element from a C stream
38  int _Meta;
39  if ((_Meta = fgetc(_File)) == EOF)
40  return (false);
41  else
42  { // got one, convert to char
43  _Byte = (char)_Meta;
44  return (true);
45  }
46  }
#define EOF
Definition: stdio.h:36
unsigned char
Definition: mbstring.h:107
template<>
bool _Fgetc ( wchar_t _Wchar,
_Filet _File 
)
inline
49  { // get a wchar_t element from a C stream
50  wint_t _Meta;
51  if ((_Meta = _CSTD fgetwc(_File)) == WEOF)
52  return (false);
53  else
54  { // got one, convert to wchar_t
55  _Wchar = (wchar_t)_Meta;
56  return (true);
57  }
58  }
unsigned short wint_t
Definition: corecrt.h:477
unsigned short wchar_t
Definition: sourceannotations.h:25
_Check_return_opt_ _ACRTIMP wint_t __cdecl fgetwc(_Inout_ FILE *_Stream)
#define _CSTD
Definition: yvals.h:570
#define WEOF
Definition: corecrt_wconio.h:18
_STD_BEGIN _CRTIMP2_PURE _Filet* __CLRCALL_PURE_OR_CDECL _Fiopen ( const char ,
ios_base::openmode  ,
int   
)
_CRTIMP2_PURE _Filet* __CLRCALL_PURE_OR_CDECL _Fiopen ( const wchar_t ,
ios_base::openmode  ,
int   
)
template<class _Elem >
bool _Fputc ( _Elem  _Ch,
_Filet _File 
)
inline
77  { // put an element to a C stream
78  return (fwrite(&_Ch, 1, sizeof (_Elem), _File) == sizeof (_Elem));
79  }
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Check_return_opt_ _ACRTIMP size_t __cdecl fwrite(_In_reads_bytes_(_ElementSize *_ElementCount) void const *_Buffer, _In_ size_t _ElementSize, _In_ size_t _ElementCount, _Inout_ FILE *_Stream)
template<>
bool _Fputc ( char  _Byte,
_Filet _File 
)
inline
82  { // put a char element to a C stream
83  return (fputc(_Byte, _File) != EOF);
84  }
#define EOF
Definition: stdio.h:36
template<>
bool _Fputc ( wchar_t  _Wchar,
_Filet _File 
)
inline
87  { // put a wchar_t element to a C stream
88  return (_CSTD fputwc(_Wchar, _File) != WEOF);
89  }
_Check_return_opt_ _ACRTIMP wint_t __cdecl fputwc(_In_ wchar_t _Character, _Inout_ FILE *_Stream)
#define _CSTD
Definition: yvals.h:570
#define WEOF
Definition: corecrt_wconio.h:18
template<class _Elem >
bool _Ungetc ( const _Elem &  _Ch,
_Filet _File 
)
inline
101  { // put back an arbitrary element to a C stream (always fail)
102  return (false);
103  }
template<>
bool _Ungetc ( const char _Byte,
_Filet _File 
)
inline
106  { // put back a char element to a C stream
107  return (ungetc((unsigned char)_Byte, _File) != EOF);
108  }
#define EOF
Definition: stdio.h:36
template<>
bool _Ungetc ( const signed char _Byte,
_Filet _File 
)
inline
111  { // put back a signed char element to a C stream
112  return (ungetc((unsigned char)_Byte, _File) != EOF);
113  }
#define EOF
Definition: stdio.h:36
template<>
bool _Ungetc ( const unsigned char _Byte,
_Filet _File 
)
inline
116  { // put back an unsigned char element to a C stream
117  return (ungetc(_Byte, _File) != EOF);
118  }
#define EOF
Definition: stdio.h:36
template<>
bool _Ungetc ( const wchar_t _Wchar,
_Filet _File 
)
inline
121  { // put back a wchar_t element to a C stream
122  return (_CSTD ungetwc(_Wchar, _File) != WEOF);
123  }
_Check_return_opt_ _ACRTIMP wint_t __cdecl ungetwc(_In_ wint_t _Character, _Inout_ FILE *_Stream)
#define _CSTD
Definition: yvals.h:570
#define WEOF
Definition: corecrt_wconio.h:18
template<class _Elem , class _Traits >
void swap ( basic_filebuf< _Elem, _Traits > &  _Left,
basic_filebuf< _Elem, _Traits > &  _Right 
)
inline
723  { // swap _Left and _Right basic_filebufs
724  _Left.swap(_Right);
725  }
void swap(_Myt &_Right)
Definition: fstream:189
template<class _Elem , class _Traits >
void swap ( basic_ifstream< _Elem, _Traits > &  _Left,
basic_ifstream< _Elem, _Traits > &  _Right 
)
inline
927  { // swap _Left and _Right basic_ifstreams
928  _Left.swap(_Right);
929  }
void swap(_Myt &_Right)
Definition: fstream:818
template<class _Elem , class _Traits >
void swap ( basic_ofstream< _Elem, _Traits > &  _Left,
basic_ofstream< _Elem, _Traits > &  _Right 
)
inline
1131  { // swap _Left and _Right basic_ofstreams
1132  _Left.swap(_Right);
1133  }
void swap(_Myt &_Right)
Definition: fstream:1022
template<class _Elem , class _Traits >
void swap ( basic_fstream< _Elem, _Traits > &  _Left,
basic_fstream< _Elem, _Traits > &  _Right 
)
inline
1340  { // swap _Left and _Right basic_fstreams
1341  _Left.swap(_Right);
1342  }
void swap(_Myt &_Right)
Definition: fstream:1231