5#ifndef FLUTTER_FML_FILE_H_
6#define FLUTTER_FML_FILE_H_
9#include <initializer_list>
13#include "flutter/fml/macros.h"
14#include "flutter/fml/unique_fd.h"
34 bool create_if_necessary,
40 bool create_if_necessary,
51 bool create_if_necessary,
56 bool create_if_necessary,
86 const std::vector<std::string>& components,
90 const char* file_name,
91 const Mapping& mapping);
98 const std::string& filename)>;
138 const char* directory_name);
146 const std::string&
path()
const {
return path_; }
~ScopedTemporaryDirectory()
ScopedTemporaryDirectory()
const std::string & path() const
Dart_NativeFunction function
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
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)
constexpr std::size_t size(T(&array)[N])
bool WriteAtomically(const fml::UniqueFD &base_directory, const char *file_name, const Mapping &mapping)
fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor)
fml::UniqueFD OpenDirectoryReadOnly(const fml::UniqueFD &base_directory, const char *path)
fml::UniqueFD OpenDirectory(const char *path, bool create_if_necessary, FilePermission permission)
bool IsFile(const std::string &path)
std::string CreateTemporaryDirectory()
bool UnlinkDirectory(const char *path)
bool TruncateFile(const fml::UniqueFD &file, size_t size)
static fml::UniqueFD CreateDirectory(const fml::UniqueFD &base_directory, const std::vector< std::string > &components, FilePermission permission, size_t index)
bool FileExists(const fml::UniqueFD &base_directory, const char *path)
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)