| 1 | /* |
| 2 | * %injeqt copyright begin% |
| 3 | * Copyright 2016 Rafał Malinowski ([email protected]) |
| 4 | * %injeqt copyright end% |
| 5 | * |
| 6 | * This library is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Lesser General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2.1 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This library is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * Lesser General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Lesser General Public |
| 17 | * License along with this library; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | */ |
| 20 | |
| 21 | #include "type-role.h"cxx . . $ `<file>/src/internal/type-role.h`/ |
| 22 | |
| 23 | #include <QtCore/QMetaClassInfo> |
| 24 | #include <QtCore/QMetaObject> |
| 25 | |
| 26 | namespace injeqtcxx . . $ injeqt/ { namespace internalcxx . . $ injeqt/internal/ { |
| 27 | |
| 28 | bool has_type_rolecxx . . $ injeqt/internal/has_type_role(d3daa6f621ef2328).(typecxx . . $ injeqt/v1/type# for_type, const stdcxx . . $ std/::stringcxx . . $ std/string# &role) |
| 29 | { |
| 30 | auto meta_object = for_type.meta_objectcxx . . $ injeqt/v1/type#meta_object(216d4151dd9c9333).(); |
| 31 | auto class_info_count = meta_object->classInfoCountcxx . . $ QMetaObject#classInfoCount(455f465bc33b4cdf).(); |
| 32 | for (decltype(class_info_count) i = 0; i < class_info_count; i++) |
| 33 | { |
| 34 | auto class_info = meta_object->classInfocxx . . $ QMetaObject#classInfo(360073a23c9dd65d).(i); |
| 35 | auto name = stdcxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f).::stringcxx . . $ std/string#{class_info.namecxx . . $ QMetaClassInfo#name(a9f41ea0e82d88cf).()}; |
| 36 | auto value = stdcxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f).::stringcxx . . $ std/string#{class_info.valuecxx . . $ QMetaClassInfo#value(a9f41ea0e82d88cf).()}; |
| 37 | if (name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). INJEQT_TYPE_ROLE_CLASSINFO_NAMEcxx . . $ `include/injeqt/injeqt.h:39:9`! && value ==cxx . . $ std/`operator==`(2965e344aacb545b). role) |
| 38 | return true; |
| 39 | } |
| 40 | |
| 41 | return false; |
| 42 | } |
| 43 | |
| 44 | }} |