瀏覽代碼

Support for declarativily ignoring `X-` keys

default_compile_flags
vector-of-bool 5 年之前
父節點
當前提交
1ef23d6b8b
共有 2 個檔案被更改,包括 8 行新增0 行删除
  1. +1
    -0
      src/dds/library_manifest.cpp
  2. +7
    -0
      src/libman/parse.hpp

+ 1
- 0
src/dds/library_manifest.cpp 查看文件

@@ -20,6 +20,7 @@ library_manifest library_manifest::load_from_file(const fs::path& fpath) {
lm::read_accumulate("Uses", uses_strings),
lm::read_accumulate("Links", links_strings),
lm::read_required("Name", ret.name),
lm::ignore_x_keys(),
lm::reject_unknown());

extend(ret.uses, ranges::views::transform(uses_strings, lm::split_usage_string));

+ 7
- 0
src/libman/parse.hpp 查看文件

@@ -255,6 +255,13 @@ public:
}
};

class ignore_x_keys {
public:
bool operator()(std::string_view, std::string_view key, std::string_view) const {
return key.find("X-") == 0;
}
};

class reject_unknown {
public:
int operator()(std::string_view context, std::string_view key, std::string_view) const {

Loading…
取消
儲存