16 std::cbegin(props.requiredFields),
17 std::cend(props.requiredFields),
18 [
this](
const std::string &requiredFieldName) {
19 return findAttribute(requiredFieldName).has_value();
22 std::cbegin(attributes),
23 std::cend(attributes),
24 [&props](
const Field &field) {
25 const auto inRequiredFields = props.requiredFields.find(field.
name) != props.requiredFields.end();
26 const auto inOptionalFields = props.optionalFields.find(field.
name) != props.optionalFields.end();
27 return inRequiredFields || inOptionalFields;
38 return id == other.id && style == other.style && attributes == other.attributes;
47 const std::string &key
48 )
const noexcept -> std::optional<Field> {
49 const auto itr = std::find_if(
50 std::cbegin(attributes),
51 std::cend(attributes),
52 [&key](
const auto &field) {
53 return field.name == key;
56 return itr == std::cend(attributes) ? std::nullopt : std::optional(*itr);
66 os <<
"(id=" << elem.id <<
", style=" << elem.style <<
", attributes=[";
67 std::for_each(std::cbegin(elem.attributes), std::cend(elem.attributes), [&os](
const Field &attribute) {