Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
emper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Schmaus
emper
Commits
8fc1a923
Commit
8fc1a923
authored
3 years ago
by
Florian Schmaus
Browse files
Options
Downloads
Patches
Plain Diff
Add apps/dirwalk
parent
e90f271d
No related branches found
No related tags found
No related merge requests found
Pipeline
#78823
failed
3 years ago
Stage: smoke-test
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/Dirwalk.cpp
+49
-0
49 additions, 0 deletions
apps/Dirwalk.cpp
apps/meson.build
+6
-0
6 additions, 0 deletions
apps/meson.build
with
55 additions
and
0 deletions
apps/Dirwalk.cpp
0 → 100644
+
49
−
0
View file @
8fc1a923
// SPDX-License-Identifier: LGPL-3.0-or-later
// Copyright © 2022 Florian Schmaus
#include
<cstdlib>
#include
<filesystem>
#include
<iostream>
#include
<sstream>
#include
<string>
#include
<vector>
#include
"Fiber.hpp"
#include
"Fibril.hpp"
#include
"Runtime.hpp"
#include
"emper-common.h"
namespace
fs
=
std
::
filesystem
;
// NOLINTNEXTLINE(clang-diagnostic-unknown-attributes)
emper_fibril
void
fibril_recursive_directory_print_walk
(
const
fs
::
path
*
dirpath
)
{
std
::
cout
<<
"DIR: "
<<
*
dirpath
<<
std
::
endl
;
std
::
vector
<
fs
::
path
>
subdirs
;
for
(
const
auto
&
path
:
fs
::
directory_iterator
(
*
dirpath
))
{
if
(
path
.
is_directory
())
{
subdirs
.
push_back
(
path
);
continue
;
}
std
::
cout
<<
path
<<
std
::
endl
;
}
Fibril
fibril
;
for
(
const
auto
&
subdir
:
subdirs
)
{
fibril
.
spawn
(
fibril_recursive_directory_print_walk
,
&
subdir
);
}
}
auto
main
(
UNUSED_ARG
int
argc
,
UNUSED_ARG
char
*
argv
[])
->
int
{
Runtime
runtime
;
auto
*
fiber
=
Fiber
::
from
([]
{
auto
cwd
=
fs
::
current_path
();
fibril_recursive_directory_print_walk
(
&
cwd
);
Runtime
::
getRuntime
()
->
initiateTermination
();
});
runtime
.
scheduleFromAnywhere
(
*
fiber
);
runtime
.
waitUntilFinished
();
return
EXIT_SUCCESS
;
}
This diff is collapsed.
Click to expand it.
apps/meson.build
+
6
−
0
View file @
8fc1a923
...
@@ -40,6 +40,12 @@ qsort = executable(
...
@@ -40,6 +40,12 @@ qsort = executable(
dependencies
:
emper_dep
,
dependencies
:
emper_dep
,
)
)
qsort
=
executable
(
'dirwalk'
,
'Dirwalk.cpp'
,
dependencies
:
emper_dep
,
)
boost_program_options_dep
=
dependency
(
'boost'
,
modules
:
[
'program_options'
])
boost_program_options_dep
=
dependency
(
'boost'
,
modules
:
[
'program_options'
])
boost_program_options_code
=
'''
boost_program_options_code
=
'''
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment