#include "include/core/SkTypes.h"
#include "src/core/SkOSFile.h"
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
Go to the source code of this file.
◆ sk_fclose()
void sk_fclose |
( |
FILE * |
f | ) |
|
◆ sk_fflush()
void sk_fflush |
( |
FILE * |
f | ) |
|
◆ sk_fgetsize()
size_t sk_fgetsize |
( |
FILE * |
f | ) |
|
Definition at line 99 of file SkOSFile_stdio.cpp.
99 {
101
102 long curr = ftell(f);
103 if (curr < 0) {
104 return 0;
105 }
106
107 fseek(f, 0, SEEK_END);
108 long size = ftell(f);
109 if (size < 0) {
111 }
112
113 fseek(f, curr, SEEK_SET);
115}
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
◆ sk_fopen()
Definition at line 64 of file SkOSFile_stdio.cpp.
64 {
65 char perm[4] = {0, 0, 0, 0};
67
70 }
73 }
75
77#ifdef _WIN32
78 file = fopen_win(path, perm);
79#else
80 file = fopen(path, perm);
81#endif
82#ifdef SK_BUILD_FOR_IOS
83
86 if (ios_get_path_in_bundle(path, &bundlePath)) {
88 }
89 }
90#endif
91
93 SkDEBUGF(
"sk_fopen: fopen(\"%s\", \"%s\") returned nullptr (errno:%d): %s\n",
94 path, perm, errno, strerror(errno));
95 }
97}
const char * c_str() const
FlutterSemanticsFlag flags
◆ sk_ftell()
size_t sk_ftell |
( |
FILE * |
f | ) |
|
Definition at line 127 of file SkOSFile_stdio.cpp.
127 {
128 long curr = ftell(f);
129 if (curr < 0) {
130 return 0;
131 }
132 return curr;
133}
◆ sk_fwrite()
size_t sk_fwrite |
( |
const void * |
buffer, |
|
|
size_t |
byteCount, |
|
|
FILE * |
f |
|
) |
| |
Definition at line 117 of file SkOSFile_stdio.cpp.
117 {
119 return fwrite(
buffer, 1, byteCount, f);
120}
static const uint8_t buffer[]
◆ sk_isdir()
bool sk_isdir |
( |
const char * |
path | ) |
|
Definition at line 141 of file SkOSFile_stdio.cpp.
141 {
142 struct stat status = {};
143 if (0 != stat(path, &status)) {
144#ifdef SK_BUILD_FOR_IOS
145
147 if (ios_get_path_in_bundle(path, &bundlePath)) {
148 if (0 != stat(bundlePath.
c_str(), &status)) {
149 return false;
150 }
151 }
152#else
153 return false;
154#endif
155 }
156 return SkToBool(status.st_mode & S_IFDIR);
157}
static constexpr bool SkToBool(const T &x)
◆ sk_mkdir()
bool sk_mkdir |
( |
const char * |
path | ) |
|
Definition at line 159 of file SkOSFile_stdio.cpp.
159 {
161 return true;
162 }
164 fprintf(stderr,
165 "sk_mkdir: path '%s' already exists but is not a directory\n",
166 path);
167 return false;
168 }
169
170 int retval;
171#ifdef _WIN32
172 retval = _mkdir(path);
173#else
174 retval = mkdir(path, 0777);
175 if (retval) {
176 perror("mkdir() failed with error: ");
177 }
178#endif
179 return 0 == retval;
180}
bool sk_exists(const char *path, SkFILE_Flags=(SkFILE_Flags) 0)
bool sk_isdir(const char *path)