BSB Developer Docs
Loading...
Searching...
No Matches
dir_walk.h
Go to the documentation of this file.
1
5#pragma once
6#include <storage/storage.h>
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12typedef struct DirWalk DirWalk;
13
19
20typedef bool (*DirWalkFilterCb)(const char* name, FileInfo* fileinfo, void* ctx);
21
28
33void dir_walk_free(DirWalk* dir_walk);
34
40void dir_walk_set_recursive(DirWalk* dir_walk, bool recursive);
41
48void dir_walk_set_filter_cb(DirWalk* dir_walk, DirWalkFilterCb cb, void* context);
49
57bool dir_walk_open(DirWalk* dir_walk, const char* path);
58
64FS_Error dir_walk_get_error(DirWalk* dir_walk);
65
73DirWalkResult dir_walk_read(DirWalk* dir_walk, FuriString* return_path, FileInfo* fileinfo);
74
79void dir_walk_close(DirWalk* dir_walk);
80
86bool dir_walk_is_dir_callback(const char* path, FileInfo* file_info, void* context);
87
88#ifdef __cplusplus
89}
90#endif
DirWalk * dir_walk_alloc(Storage *storage)
Allocate DirWalk.
Definition dir_walk.c:16
void dir_walk_close(DirWalk *dir_walk)
Close directory.
Definition dir_walk.c:158
bool dir_walk_is_dir_callback(const char *path, FileInfo *file_info, void *context)
Filter callback to be used with dir_walk_set_filter_cb.
Definition dir_walk.c:169
FS_Error dir_walk_get_error(DirWalk *dir_walk)
Get error id.
Definition dir_walk.c:148
void dir_walk_free(DirWalk *dir_walk)
Free DirWalk.
Definition dir_walk.c:28
void dir_walk_set_recursive(DirWalk *dir_walk, bool recursive)
Set recursive mode (true by default)
Definition dir_walk.c:37
DirWalkResult
Definition dir_walk.h:14
@ DirWalkOK
OK.
Definition dir_walk.h:15
@ DirWalkLast
Last element.
Definition dir_walk.h:17
@ DirWalkError
Error.
Definition dir_walk.h:16
DirWalkResult dir_walk_read(DirWalk *dir_walk, FuriString *return_path, FileInfo *fileinfo)
Read next element from directory.
Definition dir_walk.c:153
void dir_walk_set_filter_cb(DirWalk *dir_walk, DirWalkFilterCb cb, void *context)
Set filter callback (Should return true if the data is valid)
Definition dir_walk.c:42
bool dir_walk_open(DirWalk *dir_walk, const char *path)
Open directory.
Definition dir_walk.c:48
APIs for working with storages, directories and files.
Definition dir_walk.c:6
Structure that hold file info.
Definition filesystem_api_defines.h:50
Definition storage_i.h:20