23#ifdef SK_BUILD_FOR_IOS
28#if !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__) && !defined(_NEWLIB_VERSION)
42#ifdef SK_BUILD_FOR_IOS
44 if (0 == access(path, mode)) {
50 return (0 == access(path, mode));
64 struct stat status = {};
65 if (0 != fstat(fd, &status)) {
68 id->dev = status.st_dev;
69 id->ino = status.st_ino;
81 munmap(
const_cast<void*
>(addr),
length);
85 struct stat status = {};
86 if (0 != fstat(fd, &status)) {
89 if (!S_ISREG(status.st_mode)) {
92 if (!SkTFitsIn<size_t>(status.st_size)) {
95 size_t fileSize =
static_cast<size_t>(status.st_size);
97 void* addr = mmap(
nullptr, fileSize, PROT_READ, MAP_PRIVATE, fd, 0);
98 if (MAP_FAILED == addr) {
144 this->
reset(path, suffix);
150 ::closedir(
self.fDIR);
152 self.~SkOSFileIterData();
158 ::closedir(
self.fDIR);
161 self.fPath.set(path);
164 self.fDIR = ::opendir(path);
165#ifdef SK_BUILD_FOR_IOS
167 if (!
self.fDIR && ios_get_path_in_bundle(path, &
self.fPath)) {
168 self.fDIR = ::opendir(
self.fPath.c_str());
171 self.fSuffix.set(suffix);
173 self.fSuffix.reset();
179 size_t suffixLen = suffix.size();
180 size_t strLen = strlen(str);
182 return strLen >= suffixLen &&
183 memcmp(suffix.c_str(), str + strLen - suffixLen, suffixLen) == 0;
191 while ((entry = ::readdir(
self.fDIR)) !=
nullptr) {
198 str.
append(entry->d_name);
200 if (0 == stat(str.
c_str(), &
s)) {
202 if (
s.st_mode & S_IFDIR) {
214 name->set(entry->d_name);
static bool issuffixfor(const SkString &suffix, const char str[])
bool sk_exists(const char *path, SkFILE_Flags flags)
size_t sk_qread(FILE *file, void *buffer, size_t count, size_t offset)
void sk_fmunmap(const void *addr, size_t length)
void * sk_fmmap(FILE *f, size_t *size)
bool sk_fidentical(FILE *a, FILE *b)
static bool sk_ino(FILE *a, SkFILEID *id)
void * sk_fdmmap(int fd, size_t *size)
SK_SPI void reset(const char path[], const char suffix[]=nullptr)
SK_SPI bool next(SkString *name, bool getDir=false)
static const size_t kStorageSize
void append(const char text[])
bool endsWith(const char suffixStr[]) const
const char * c_str() const
FlutterSemanticsFlag flags
static const uint8_t buffer[]