keep-prefix keeps relative pathing (#7394)

This commit is contained in:
Derek Bailey
2022-07-26 15:11:54 -07:00
committed by GitHub
parent 52fce5e532
commit 6e2791640e
7 changed files with 30 additions and 10 deletions

View File

@@ -577,7 +577,7 @@ struct IDLOptions {
bool allow_non_utf8;
bool natural_utf8;
std::string include_prefix;
bool keep_include_path;
bool keep_prefix;
bool binary_schema_comments;
bool binary_schema_builtins;
bool binary_schema_gen_embed;
@@ -683,7 +683,7 @@ struct IDLOptions {
union_value_namespacing(true),
allow_non_utf8(false),
natural_utf8(false),
keep_include_path(false),
keep_prefix(false),
binary_schema_comments(false),
binary_schema_builtins(false),
binary_schema_gen_embed(false),
@@ -1054,11 +1054,11 @@ class Parser : public ParserState {
uint64_t advanced_features_;
std::string file_being_parsed_;
private:
const char *source_;
std::string file_being_parsed_;
std::vector<std::pair<Value, FieldDef *>> field_stack_;
// TODO(cneo): Refactor parser to use string_cache more often to save

View File

@@ -448,6 +448,9 @@ std::string StripPath(const std::string &filepath);
// Strip the last component of the path + separator.
std::string StripFileName(const std::string &filepath);
std::string StripPrefix(const std::string &filepath,
const std::string &prefix_to_remove);
// Concatenates a path with a filename, regardless of whether the path
// ends in a separator or not.
std::string ConCatPathFileName(const std::string &path,