Add absolute file names option to BFBS (#8055)

* Add absolute file names option (#1)

* Use ternary style for if

---------

Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
James Courtney
2023-11-19 10:58:03 -08:00
committed by GitHub
parent d3055a97e7
commit 7d6d99c6be
5 changed files with 21 additions and 6 deletions

View File

@@ -676,6 +676,7 @@ struct IDLOptions {
bool binary_schema_comments;
bool binary_schema_builtins;
bool binary_schema_gen_embed;
bool binary_schema_absolute_paths;
std::string go_import;
std::string go_namespace;
std::string go_module_name;
@@ -796,6 +797,7 @@ struct IDLOptions {
binary_schema_comments(false),
binary_schema_builtins(false),
binary_schema_gen_embed(false),
binary_schema_absolute_paths(false),
protobuf_ascii_alike(false),
size_prefixed(false),
force_defaults(false),

View File

@@ -479,6 +479,11 @@ std::string PosixPath(const std::string &path);
// creating dirs for any parts of the path that don't exist yet.
void EnsureDirExists(const std::string &filepath);
// Obtains the relative or absolute path.
std::string FilePath(const std::string &project,
const std::string &filePath,
bool absolute);
// Obtains the absolute path from any other path.
// Returns the input path if the absolute path couldn't be resolved.
std::string AbsolutePath(const std::string &filepath);