File indexing completed on 2025-02-09 04:28:40
0001 /* 0002 This file is part of the KTextTemplate library 0003 0004 SPDX-FileCopyrightText: 2010 Stephen Kelly <steveire@gmail.com> 0005 0006 SPDX-License-Identifier: LGPL-2.1-or-later 0007 0008 */ 0009 0010 #ifndef KTEXTTEMPLATE_TYPEACCESSOR_H 0011 #define KTEXTTEMPLATE_TYPEACCESSOR_H 0012 0013 #include "ktexttemplate_export.h" 0014 0015 #include <QObject> 0016 0017 /// @file 0018 0019 namespace KTextTemplate 0020 { 0021 0022 #ifndef K_DOXYGEN 0023 template<typename T> 0024 struct TypeAccessor { 0025 static QVariant lookUp(const T object, const QString &property); 0026 }; 0027 0028 template<typename T> 0029 struct TypeAccessor<T *> { 0030 static QVariant lookUp(const T *const object, const QString &property); 0031 }; 0032 0033 template<typename T> 0034 struct TypeAccessor<T &> { 0035 static QVariant lookUp(const T &object, const QString &property); 0036 }; 0037 #endif 0038 } 0039 0040 #endif