Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baichixing
ygopro
Commits
92375f75
Commit
92375f75
authored
Nov 21, 2018
by
mercury233
Committed by
DailyShana
Nov 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use windows api instead of c runtime library in myfilesystem.h (#2160)
parent
e2d4af84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
gframe/myfilesystem.h
gframe/myfilesystem.h
+6
-9
No files found.
gframe/myfilesystem.h
View file @
92375f75
...
...
@@ -5,10 +5,7 @@
#include <functional>
#include "bufferio.h"
#ifdef _WIN32
#include <direct.h>
#include <sys/stat.h>
#else
#ifndef _WIN32
#include <dirent.h>
#include <sys/stat.h>
#endif
...
...
@@ -20,8 +17,8 @@
class
FileSystem
{
public:
static
bool
IsFileExists
(
const
wchar_t
*
wfile
)
{
struct
_stat
fileStat
;
return
(
_wstat
(
wfile
,
&
fileStat
)
==
0
)
&&
!
(
fileStat
.
st_mode
&
_S_IFDIR
);
DWORD
attr
=
GetFileAttributesW
(
wfile
)
;
return
attr
!=
INVALID_FILE_ATTRIBUTES
&&
!
(
attr
&
FILE_ATTRIBUTE_DIRECTORY
);
}
static
bool
IsFileExists
(
const
char
*
file
)
{
...
...
@@ -31,8 +28,8 @@ public:
}
static
bool
IsDirExists
(
const
wchar_t
*
wdir
)
{
struct
_stat
fileStat
;
return
(
_wstat
(
wdir
,
&
fileStat
)
==
0
)
&&
(
fileStat
.
st_mode
&
_S_IFDIR
);
DWORD
attr
=
GetFileAttributesW
(
wdir
)
;
return
attr
!=
INVALID_FILE_ATTRIBUTES
&&
(
attr
&
FILE_ATTRIBUTE_DIRECTORY
);
}
static
bool
IsDirExists
(
const
char
*
dir
)
{
...
...
@@ -42,7 +39,7 @@ public:
}
static
bool
MakeDir
(
const
wchar_t
*
wdir
)
{
return
_wmkdir
(
wdir
)
==
0
;
return
CreateDirectoryW
(
wdir
,
NULL
)
;
}
static
bool
MakeDir
(
const
char
*
dir
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment