7#include "core/fxcrt/fx_folder.h"
11#include "build/build_config.h"
12#include "core/fxcrt/unowned_ptr.h"
13#include "third_party/base/memory/ptr_util.h"
16#error "built on wrong platform"
27 bool GetNextFile(ByteString* filename,
bool* bFolder)
override;
31 FX_PosixFolder(
const ByteString& path, DIR* dir);
33 const ByteString m_Path;
37std::unique_ptr<FX_Folder>
FX_Folder::OpenFolder(
const ByteString& path) {
47 : m_Path(path), m_Dir(dir) {}
50 closedir(m_Dir.ExtractAsDangling());
54 struct dirent* de = readdir(m_Dir);
58 ByteString fullpath = m_Path +
"/" + de->d_name;
60 if (stat(fullpath
.c_str(), &deStat) < 0)
63 *filename
= de->d_name;
64 *bFolder = S_ISDIR(deStat.st_mode);
bool GetNextFile(ByteString *filename, bool *bFolder) override
~FX_PosixFolder() override
ByteString & operator=(const char *str)
const char * c_str() const