Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F131280
file_scanner.hpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
856 B
Referenced Files
None
Subscribers
None
file_scanner.hpp
View Options
#pragma once
#include
<filesystem>
#include
<string>
#include
<vector>
namespace
fs
=
std
::
filesystem
;
namespace
ivy
{
class
FileScanner
{
std
::
string
m_base_dir
;
public
:
explicit
FileScanner
(
const
std
::
string
base_dir
)
:
m_base_dir
(
base_dir
)
{}
std
::
vector
<
std
::
string
>
scan
()
{
std
::
vector
<
std
::
string
>
results
;
for
(
const
fs
::
directory_entry
&
dir_entry
:
fs
::
recursive_directory_iterator
(
m_base_dir
))
{
fs
::
path
path
=
dir_entry
.
path
();
// TODO(ade): sort out some kind of ignore thing. This will be needed
// when we start adding wildcard ignore functionality
if
(
path
.
string
().
find
(
".git"
)
!=
std
::
string
::
npos
)
{
continue
;
}
if
(
dir_entry
.
is_regular_file
())
{
results
.
emplace_back
(
fs
::
relative
(
path
,
m_base_dir
));
}
}
return
results
;
}
};
}
// namespace ivy
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Apr 6 2026, 5:27 PM (5 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15632
Default Alt Text
file_scanner.hpp (856 B)
Attached To
Mode
R1 ivy.nvim
Attached
Detach File
Event Timeline
Log In to Comment