1/* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16% Metadata::item_types.each do |item_type| 17std::optional<Metadata::Error> 18<%= MetadataGen::class_name(item_type) %>::Validate(<%= MetadataGen::validate_arg_list(item_type, true).join(', ') %>) const { 19<%= MetadataGen::validate_body(item_type, true).join("\n") %> 20} 21 22std::optional<Metadata::Error> 23<%= MetadataGen::class_name(item_type) %>::Validate(<%= MetadataGen::validate_arg_list(item_type, false).join(', ') %>) const { 24<%= MetadataGen::validate_body(item_type, false).join("\n") %> 25} 26 27% end 28% 29% Metadata::item_types.each do |item_type| 30void <%= MetadataGen::class_name(item_type) %>::SetFlags(<%= MetadataGen::flags_arg_list(item_type, true).join(', ') %>) { 31<%= MetadataGen::set_flags_body(item_type, true).join("\n") %> 32} 33 34void <%= MetadataGen::class_name(item_type) %>::SetFlags(<%= MetadataGen::flags_arg_list(item_type, false).join(', ') %>) { 35<%= MetadataGen::set_flags_body(item_type, false).join("\n") %> 36} 37 38void <%= MetadataGen::class_name(item_type) %>::RemoveFlags(<%= MetadataGen::flags_arg_list(item_type, true).join(', ') %>) { 39<%= MetadataGen::remove_flags_body(item_type, true).join("\n") %> 40} 41 42void <%= MetadataGen::class_name(item_type) %>::RemoveFlags(<%= MetadataGen::flags_arg_list(item_type, false).join(', ') %>) { 43<%= MetadataGen::remove_flags_body(item_type, false).join("\n") %> 44} 45 46% end 47