1/* 2 * Copyright (c) 2021-2022 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 17% Metadata::item_types.each do |item_type| 18std::optional<Metadata::Error> 19<%= MetadataGen::class_name(item_type) %>::Validate(<%= MetadataGen::validate_arg_list(item_type, true).join(', ') %>) const { 20<%= MetadataGen::validate_body(item_type, true).join("\n") %> 21} 22 23std::optional<Metadata::Error> 24<%= MetadataGen::class_name(item_type) %>::Validate(<%= MetadataGen::validate_arg_list(item_type, false).join(', ') %>) const { 25<%= MetadataGen::validate_body(item_type, false).join("\n") %> 26} 27 28% end 29% 30% Metadata::item_types.each do |item_type| 31void <%= MetadataGen::class_name(item_type) %>::SetFlags(<%= MetadataGen::flags_arg_list(item_type, true).join(', ') %>) { 32<%= MetadataGen::set_flags_body(item_type, true).join("\n") %> 33} 34 35void <%= MetadataGen::class_name(item_type) %>::SetFlags(<%= MetadataGen::flags_arg_list(item_type, false).join(', ') %>) { 36<%= MetadataGen::set_flags_body(item_type, false).join("\n") %> 37} 38 39void <%= MetadataGen::class_name(item_type) %>::RemoveFlags(<%= MetadataGen::flags_arg_list(item_type, true).join(', ') %>) { 40<%= MetadataGen::remove_flags_body(item_type, true).join("\n") %> 41} 42 43void <%= MetadataGen::class_name(item_type) %>::RemoveFlags(<%= MetadataGen::flags_arg_list(item_type, false).join(', ') %>) { 44<%= MetadataGen::remove_flags_body(item_type, false).join("\n") %> 45} 46 47% end 48