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  }
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
_Check_return_opt_ _CRTIMP size_t __cdecl fread(_Out_writes_bytes_(_ElementSize *_Count) void *_DstBuf, _In_ size_t _ElementSize, _In_ size_t _Count, _Inout_ FILE *_File)
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  }
_Check_return_opt_ _CRTIMP int __cdecl fgetc(_Inout_ FILE *_File)
#define EOF
Definition: stdio.h:59
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  }
_Check_return_opt_ _CRTIMP wint_t __cdecl fgetwc(_Inout_ FILE *_File)
unsigned short wint_t
Definition: crtdefs.h:541
unsigned short wchar_t
Definition: crtdefs.h:536
#define WEOF
Definition: ctype.h:26
#define _CSTD
Definition: yvals.h:559
_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_opt_ _CRTIMP size_t __cdecl fwrite(_In_reads_bytes_(_Size *_Count) const void *_Str, _In_ size_t _Size, _In_ size_t _Count, _Inout_ FILE *_File)
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
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:59
_Check_return_opt_ _CRTIMP int __cdecl fputc(_In_ int _Ch, _Inout_ FILE *_File)
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_ _CRTIMP wint_t __cdecl fputwc(_In_ wchar_t _Ch, _Inout_ FILE *_File)
#define WEOF
Definition: ctype.h:26
#define _CSTD
Definition: yvals.h:559
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:59
_Check_return_opt_ _CRTIMP int __cdecl ungetc(_In_ int _Ch, _Inout_ FILE *_File)
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:59
_Check_return_opt_ _CRTIMP int __cdecl ungetc(_In_ int _Ch, _Inout_ FILE *_File)
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:59
_Check_return_opt_ _CRTIMP int __cdecl ungetc(_In_ int _Ch, _Inout_ FILE *_File)
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_ _CRTIMP wint_t __cdecl ungetwc(_In_ wint_t _Ch, _Inout_ FILE *_File)
#define WEOF
Definition: ctype.h:26
#define _CSTD
Definition: yvals.h:559
template<class _Elem , class _Traits >
void swap ( basic_filebuf< _Elem, _Traits > &  _Left,
basic_filebuf< _Elem, _Traits > &  _Right 
)
inline
714  { // swap _Left and _Right basic_filebufs
715  _Left.swap(_Right);
716  }
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
912  { // swap _Left and _Right basic_ifstreams
913  _Left.swap(_Right);
914  }
void swap(_Myt &_Right)
Definition: fstream:809
template<class _Elem , class _Traits >
void swap ( basic_ofstream< _Elem, _Traits > &  _Left,
basic_ofstream< _Elem, _Traits > &  _Right 
)
inline
1110  { // swap _Left and _Right basic_ofstreams
1111  _Left.swap(_Right);
1112  }
void swap(_Myt &_Right)
Definition: fstream:1007
template<class _Elem , class _Traits >
void swap ( basic_fstream< _Elem, _Traits > &  _Left,
basic_fstream< _Elem, _Traits > &  _Right 
)
inline
1313  { // swap _Left and _Right basic_fstreams
1314  _Left.swap(_Right);
1315  }
void swap(_Myt &_Right)
Definition: fstream:1210