-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfile.h
64 lines (53 loc) · 2.65 KB
/
file.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* ******************************************************************** **
** @@ File
** @ Copyrt :
** @ Author :
** @ Modify :
** @ Update :
** @ Notes :
** ******************************************************************** */
#ifndef __FILE_HPP__
#define __FILE_HPP__
/* ******************************************************************** **
** @@ internal defines
** ******************************************************************** */
#if _MSC_VER > 1000
#pragma once
#endif
/* ******************************************************************** **
** @@ internal prototypes
** ******************************************************************** */
/* ******************************************************************** **
** @@ external global variables
** ******************************************************************** */
/* ******************************************************************** **
** @@ static global variables
** ******************************************************************** */
/* ******************************************************************** **
** @@ Classes
** ******************************************************************** */
/* ******************************************************************** **
** @@ prototypes
** ******************************************************************** */
bool ReadBuffer (HANDLE hFile,void* pBuf,DWORD dwBufSize);
bool WriteBuffer(HANDLE hFile,const void* const pBuf,DWORD dwBufSize);
HANDLE CreateFile(const char* const pszFileName,DWORD dwCreationDisposition = CREATE_ALWAYS,DWORD dwShareMode = FILE_SHARE_READ);
HANDLE OpenFileReadWrite(const char* const pszFileName,DWORD dwShareMode = FILE_SHARE_READ);
HANDLE OpenFileReadOnly(const char* const pszFileName);
HANDLE Open_or_CreateFile(const char* const pszFileName);
DWORD GetFilePointer(HANDLE hFile);
DWORD GetFileSizeLo(HANDLE hFile);
DWORD SetFilePointerBOF(HANDLE hFile);
DWORD SetFilePointerEOF(HANDLE hFile);
// SEEK_SET - The starting point is zero or the beginning of the file.
// SEEK_CUR - The starting point is the current value of the file pointer.
// SEEK_END - The starting point is the current end-of-file position.
DWORD SetFilePointerCUR(HANDLE hFile,int iOfs,DWORD dwMethod);
bool GetLatestFileTime(HANDLE hFile,FILETIME& rFileTime);
bool GetLatestFileTime(const char* const pszFile,FILETIME& rFileTime);
bool IsValidFileName(const char* const pszFileName);
void EnsureDirectory(const char* const pszPath);
#endif
/* ******************************************************************** **
** End of File
** ******************************************************************** */