31 const char* ext =
nullptr,
int files = 0) {
43 if (
p_client ==
nullptr)
return false;
90 if (
p_client ==
nullptr || path ==
nullptr)
return nullptr;
93 LOGE(
"Path not found: %s", path);
96 if (info.isDirectory) {
98 if (!
begin())
return nullptr;
142 LOGI(
"open %s", path);
145 LOGE(
"Could not open %s", path);
157 bool ok =
p_client->listDir(dir.
c_str(), [&](
const smb::FileInfo& info) {
158 if (info.name.empty() || info.name ==
"." || info.name ==
"..")
160 Str path{dir.c_str()};
161 if (!path.endsWith(
"/")) path +=
"/";
162 path += info.name.c_str();
163 if (info.isDirectory) {
164 walk(path, target, n, result);
166 if (n == target && result !=
nullptr) {
167 *result = path.
c_str();
177 bool isMaxReached(
int n) {
return max_files > 0 && n >= (int)max_files; }
180 if (index < 0)
return false;
181 if (max_files > 0 && index >= (
int)max_files)
return false;
182 if (file_count >= 0 && index >= file_count) {
183 LOGW(
"index %d is out of range (size: %d)", index, file_count);
190 if (file ==
nullptr)
return false;
191 if (ext ==
nullptr)
return true;
#define LOGW(...)
Definition AudioLoggerIDF.h:29
#define TRACED()
Definition AudioLoggerIDF.h:31
#define LOGI(...)
Definition AudioLoggerIDF.h:28
#define LOGE(...)
Definition AudioLoggerIDF.h:30