5#include "flutter/fml/file.h"
7#include "flutter/fml/logging.h"
8#include "flutter/fml/unique_fd.h"
13 const std::vector<std::string>& components,
18 const char* file_path = components[index].c_str();
20 auto directory =
OpenDirectory(base_directory, file_path,
true, permission);
22 if (!directory.is_valid()) {
26 if (index == components.size() - 1) {
34 const std::vector<std::string>& components,
40 if (components.empty()) {
58 FML_LOG(
ERROR) <<
"Could not clean directory: " << path_;
66 FML_LOG(
ERROR) <<
"Could not remove directory: " << path_;
73 FileVisitor recursive_visitor = [&recursive_visitor, &visitor](
75 const std::string& filename) {
76 if (!visitor(directory, filename)) {
82 FML_LOG(
ERROR) <<
"Can't open sub-directory: " << filename;
89 return VisitFiles(directory, recursive_visitor);
105 const std::string& filename) {
110 removed =
VisitFiles(sub_dir, recursive_cleanup) &&
117 return VisitFiles(directory, recursive_cleanup);
121 const char* directory_name) {
~ScopedTemporaryDirectory()
ScopedTemporaryDirectory()
void reset(const T &value=Traits::InvalidValue())
#define FML_LOG(severity)
#define FML_DCHECK(condition)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets dir
fml::UniqueFD OpenFileReadOnly(const fml::UniqueFD &base_directory, const char *path)
bool VisitFiles(const fml::UniqueFD &directory, const FileVisitor &visitor)
bool RemoveFilesInDirectory(const fml::UniqueFD &directory)
fml::UniqueFD OpenDirectoryReadOnly(const fml::UniqueFD &base_directory, const char *path)
fml::UniqueFD OpenDirectory(const char *path, bool create_if_necessary, FilePermission permission)
std::string CreateTemporaryDirectory()
bool UnlinkDirectory(const char *path)
static fml::UniqueFD CreateDirectory(const fml::UniqueFD &base_directory, const std::vector< std::string > &components, FilePermission permission, size_t index)
bool UnlinkFile(const char *path)
fml::UniqueFD OpenFile(const char *path, bool create_if_necessary, FilePermission permission)
This can open a directory on POSIX, but not on Windows.
bool RemoveDirectoryRecursively(const fml::UniqueFD &parent, const char *directory_name)
bool VisitFilesRecursively(const fml::UniqueFD &directory, const FileVisitor &visitor)
std::function< bool(const fml::UniqueFD &directory, const std::string &filename)> FileVisitor
bool IsDirectory(const fml::UniqueFD &directory)