ReactOS  0.4.13-dev-235-g7373cb3
fstream_win32io.cpp File Reference
#include <fstream>
#include <io.h>
#include <fcntl.h>
#include <sys/stat.h>
Include dependency graph for fstream_win32io.cpp:

Go to the source code of this file.

Macros

#define _TEXTBUF_SIZE   0x1000
 
#define INVALID_SET_FILE_POINTER   0xffffffff
 
#define O_ACCMODE   (O_RDONLY|O_WRONLY|O_RDWR)
 
#define _STLP_LF   10
 
#define _STLP_CR   13
 
#define _STLP_CTRLZ   26
 

Functions

static _STLP_BEGIN_NAMESPACE ios_base::openmode flag_to_openmode (int mode)
 
static _STLP_MOVE_TO_PRIV_NAMESPACE bool __is_regular_file (_STLP_fd fd)
 
static streamoff __file_size (_STLP_fd fd)
 

Variables

const _STLP_fd INVALID_STLP_FD = INVALID_HANDLE_VALUE
 

Macro Definition Documentation

◆ _STLP_CR

#define _STLP_CR   13

Definition at line 384 of file fstream_win32io.cpp.

◆ _STLP_CTRLZ

#define _STLP_CTRLZ   26

Definition at line 385 of file fstream_win32io.cpp.

◆ _STLP_LF

#define _STLP_LF   10

Definition at line 383 of file fstream_win32io.cpp.

◆ _TEXTBUF_SIZE

#define _TEXTBUF_SIZE   0x1000

Definition at line 31 of file fstream_win32io.cpp.

◆ INVALID_SET_FILE_POINTER

#define INVALID_SET_FILE_POINTER   0xffffffff

Definition at line 36 of file fstream_win32io.cpp.

◆ O_ACCMODE

#define O_ACCMODE   (O_RDONLY|O_WRONLY|O_RDWR)

Definition at line 40 of file fstream_win32io.cpp.

Function Documentation

◆ __file_size()

static streamoff __file_size ( _STLP_fd  fd)
static

Definition at line 81 of file fstream_win32io.cpp.

81  {
82  streamoff ret = 0;
83 
84  LARGE_INTEGER li;
85  li.LowPart = GetFileSize(fd, (unsigned long*) &li.HighPart);
87  ret = li.QuadPart;
88 
89  return ret;
90 }
off_t streamoff
Definition: char_traits.h:74
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static int fd
Definition: io.c:51
#define INVALID_FILE_SIZE
Definition: winbase.h:529
#define NO_ERROR
Definition: dderror.h:5
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:481
int ret
ULONG LowPart
Definition: typedefs.h:104
LONGLONG QuadPart
Definition: typedefs.h:112

◆ __is_regular_file()

static _STLP_MOVE_TO_PRIV_NAMESPACE bool __is_regular_file ( _STLP_fd  fd)
static

Definition at line 72 of file fstream_win32io.cpp.

72  {
74 
75  // Return true if the file handle isn't a directory.
76  return GetFileInformationByHandle(fd, &info) &&
77  ((info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0);
78 }
static int fd
Definition: io.c:51
struct _test_info info[]
Definition: SetCursorPos.c:19
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
BOOL WINAPI GetFileInformationByHandle(HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation)
Definition: fileinfo.c:608

◆ flag_to_openmode()

static _STLP_BEGIN_NAMESPACE ios_base::openmode flag_to_openmode ( int  mode)
static

Definition at line 46 of file fstream_win32io.cpp.

46  {
47  ios_base::openmode ret = ios_base::__default_mode;
48 
49  switch (mode & O_ACCMODE) {
50  case O_RDONLY:
51  ret = ios_base::in; break;
52  case O_WRONLY:
53  ret = ios_base::out; break;
54  case O_RDWR:
55  ret = ios_base::in | ios_base::out; break;
56  }
57 
58  if (mode & O_APPEND)
59  ret |= ios_base::app;
60 
61  if (mode & O_BINARY)
63 
64  return ret;
65 }
#define O_ACCMODE
#define O_WRONLY
Definition: acwin.h:85
int openmode
Definition: _ios_base.h:59
static FILE * out
Definition: regtests2xml.c:44
const GLuint GLenum const GLvoid * binary
Definition: glext.h:7538
int ret
GLenum mode
Definition: glext.h:6217
GLuint in
Definition: glext.h:9616
#define O_RDWR
Definition: fcntl.h:36
#define O_BINARY
Definition: acwin.h:83
#define O_APPEND
Definition: fcntl.h:37
#define O_RDONLY
Definition: acwin.h:82

Variable Documentation

◆ INVALID_STLP_FD

const _STLP_fd INVALID_STLP_FD = INVALID_HANDLE_VALUE

Definition at line 33 of file fstream_win32io.cpp.