70 if( element_stats.
exists() ) {
81 if( !element_stats.
exists() ) {
94 }
else if( element_stats.
is_dir() ) {
121 return lhs.total_file_bytes == rhs.total_file_bytes &&
122 lhs.total_real == rhs.total_real &&
123 lhs.total_sym_links_existing == rhs.total_sym_links_existing &&
124 lhs.total_sym_links_not_existing == rhs.total_sym_links_not_existing &&
125 lhs.total_no_access == rhs.total_no_access &&
126 lhs.total_not_existing == rhs.total_not_existing &&
127 lhs.files_real == rhs.files_real &&
128 lhs.files_sym_link == rhs.files_sym_link &&
129 lhs.dirs_real == rhs.dirs_real &&
130 lhs.dirs_sym_link == rhs.dirs_sym_link;
133 return !( lhs == rhs );
138 const std::string image_file =
"test_data.sqfs";
140 const std::string project_root1a =
"../../test_data";
142 const std::string project_root1b =
"../../../test_data";
144 const std::string project_root2a =
"../../../jaulib/test_data";
146 const std::string project_root2b =
"../../../../jaulib/test_data";
153 std::string path = test_exe_dir +
"/" + project_root1a;
155 if( path_stats.
exists() ) {
158 path = test_exe_dir +
"/" + project_root1b;
160 if( path_stats.
exists() ) {
163 path = test_exe_dir +
"/" + project_root2a;
165 if( path_stats.
exists() ) {
168 path = test_exe_dir +
"/" + project_root2b;
170 if( path_stats.
exists() ) {
177 std::string path = test_exe_dir +
"/" + project_root1a;
179 if( path_stats.
exists() ) {
180 return project_root1a;
182 path = test_exe_dir +
"/" + project_root1b;
184 if( path_stats.
exists() ) {
185 return project_root1b;
187 path = test_exe_dir +
"/" + project_root2a;
189 if( path_stats.
exists() ) {
190 return project_root2a;
192 path = test_exe_dir +
"/" + project_root2b;
194 if( path_stats.
exists() ) {
195 return project_root2b;
201 std::string path = test_exe_dir +
"/" + image_file;
203 if( path_stats.
exists() ) {
jau::fs::file_stats getTestDataImageFile(const std::string &test_exe_path) noexcept
const std::string temp_root
const std::string dest_fs_vfat
std::string getTestDataRelDir(const std::string &test_exe_path) noexcept
jau::fs::file_stats getTestDataDirStats(const std::string &test_exe_path) noexcept
const std::string project_root_ext
Platform agnostic representation of POSIX ::lstat() and ::stat() for a given pathname.
constexpr bool exists() const noexcept
Returns true if entity does not exist, exclusive bit.
constexpr bool is_link() const noexcept
Returns true if entity is a symbolic link, might be in combination with is_file(),...
constexpr bool is_file() const noexcept
Returns true if entity is a file, might be in combination with is_link().
constexpr bool is_dir() const noexcept
Returns true if entity is a directory, might be in combination with is_link().
uint64_t size() const noexcept
Returns the size in bytes of this element if is_file(), otherwise zero.
constexpr bool has_access() const noexcept
Returns true if entity gives no access to user, exclusive bit.
std::string to_string(const alphabet &v) noexcept
std::string dirname(const std::string_view &path) noexcept
Return stripped last component from given path separated by /, excluding the trailing separator /.
traverse_options
Filesystem traverse options used to visit() path elements.
std::string to_string(const fmode_t mask, const bool show_rwx=false) noexcept
Return the string representation of fmode_t.
@ follow_symlinks
Traverse through symbolic linked directories if traverse_options::recursive is set,...
std::string to_decstring(const value_type &v, const char separator=',', const nsize_t width=0) noexcept
Produce a decimal string representation of an integral integer value.
constexpr bool is_set(const cpu_family_t mask, const cpu_family_t bit) noexcept
jau::fs::traverse_options topts
std::string to_string() const noexcept
visitor_stats(jau::fs::traverse_options topts_)
int total_sym_links_not_existing
int total_sym_links_existing
void add(const jau::fs::file_stats &element_stats)
constexpr bool operator!=(const visitor_stats &lhs, const visitor_stats &rhs) noexcept
constexpr bool operator==(const visitor_stats &lhs, const visitor_stats &rhs) noexcept
static constexpr const bool _remove_target_test_dir