Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
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
Libraries
spdlog
Commits
b55d95d3
Commit
b55d95d3
authored
Sep 15, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update test utils for windows
parent
494cc8ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
tests/utils.cpp
tests/utils.cpp
+24
-1
No files found.
tests/utils.cpp
View file @
b55d95d3
...
...
@@ -69,7 +69,30 @@ bool ends_with(std::string const &value, std::string const &ending)
}
#ifdef _WIN32
std
::
size_t
count_files
(
const
std
::
string
&
folder
)
{}
// source: https://stackoverflow.com/a/37416569/192001
std
::
size_t
count_files
(
const
std
::
string
&
folder
)
{
counter
counter
=
0
;
WIN32_FIND_DATA
ffd
;
HANDLE
hFind
=
INVALID_HANDLE_VALUE
;
// Start iterating over the files in the path directory.
hFind
=
::
FindFirstFileA
(
path
.
c_str
(),
&
ffd
);
if
(
hFind
!=
INVALID_HANDLE_VALUE
)
{
do
// Managed to locate and create an handle to that folder.
{
counter
++
;
}
while
(
::
FindNextFile
(
hFind
,
&
ffd
)
==
TRUE
);
::
FindClose
(
hFind
);
}
else
{
throw
std
::
runtime_error
(
"Failed open folder "
+
folder
);
}
return
counter
;
}
#else
// Based on: https://stackoverflow.com/a/2802255/192001
std
::
size_t
count_files
(
const
std
::
string
&
folder
)
...
...
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