12#include "flutter/fml/file.h"
26 stream <<
"SceneC is an offline 3D geometry file parser." << std::endl;
27 stream <<
"---------------------------------------------------------------"
29 stream <<
"Valid Argument are:" << std::endl;
30 stream <<
"--input=<source_file>" << std::endl;
31 stream <<
"[optional] --input-kind={";
33 stream << source_type.first <<
", ";
35 stream <<
"} (default: gltf)" << std::endl;
36 stream <<
"--output=<output_file>" << std::endl;
45 auto source_type_option =
51 return source_type_search->second;
59 source_file_name(command_line.GetOptionValueWithDefault(
"input",
"")),
61 output_file_name(command_line.GetOptionValueWithDefault(
"output",
"")) {
71 explain <<
"Unknown input type." << std::endl;
76 explain <<
"Could not figure out working directory." << std::endl;
81 explain <<
"Input file name was empty." << std::endl;
86 explain <<
"Target output file name was empty." << std::endl;
std::string GetOptionValueWithDefault(std::string_view name, std::string_view default_value) const
fml::UniqueFD OpenDirectory(const char *path, bool create_if_necessary, FilePermission permission)
UniqueObject< int, internal::os_unix::UniqueFDTraits > UniqueFD
std::string Utf8FromPath(const std::filesystem::path &path)
Converts a native format path to a utf8 string.
static SourceType SourceTypeFromCommandLine(const fml::CommandLine &command_line)
static const std::map< std::string, SourceType > kKnownSourceTypes
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