8#include "flutter/fml/backtrace.h"
9#include "flutter/fml/command_line.h"
10#include "flutter/fml/file.h"
11#include "flutter/fml/mapping.h"
15#include "impeller/scene/importer/scene_flatbuffers.h"
19#include "third_party/flatbuffers/include/flatbuffers/flatbuffer_builder.h"
28 std::filesystem::perms::owner_read | std::filesystem::perms::owner_write |
29 std::filesystem::perms::group_read | std::filesystem::perms::others_read;
30 std::error_code
error;
31 std::filesystem::permissions(
p, permissions,
error);
33 std::cerr <<
"Failed to set access on file '" <<
p
34 <<
"': " <<
error.message() << std::endl;
49 std::cerr <<
"Invalid flags specified." << std::endl;
54 auto source_file_mapping =
56 if (!source_file_mapping) {
57 std::cerr <<
"Could not open input file." << std::endl;
65 success =
ParseGLTF(*source_file_mapping, scene);
68 std::cerr <<
"Unknown input type." << std::endl;
72 std::cerr <<
"Failed to parse input file." << std::endl;
76 flatbuffers::FlatBufferBuilder
builder;
79 auto output_file_name = std::filesystem::absolute(
bool HasOption(std::string_view name, size_t *index=nullptr) const
static std::unique_ptr< FileMapping > CreateReadOnly(const std::string &path)
const uint8_t uint32_t uint32_t GError ** error
static void * Pack(const T &ctx, SkArenaAlloc *alloc)
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
bool WriteAtomically(const fml::UniqueFD &base_directory, const char *file_name, const Mapping &mapping)
void InstallCrashHandler()
CommandLine CommandLineFromPlatformOrArgcArgv(int argc, const char *const *argv)
std::string Utf8FromPath(const std::filesystem::path &path)
Converts a native format path to a utf8 string.
bool Main(const fml::CommandLine &command_line)
static bool SetPermissiveAccess(const std::filesystem::path &p)
bool ParseGLTF(const fml::Mapping &source_mapping, fb::SceneT &out_scene)
int main(int argc, char const *argv[])
std::shared_ptr< fml::UniqueFD > working_directory
std::string output_file_name
std::string source_file_name
static void PrintHelp(std::ostream &stream)
bool AreValid(std::ostream &explain) const