File indexing completed on 2024-05-12 04:38:01
0001 /* 0002 SPDX-FileCopyrightText: 2007 David Nolden <david.nolden.kdevelop@art-master.de> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef KDEVPLATFORM_DUMPDOTGRAPH_H 0008 #define KDEVPLATFORM_DUMPDOTGRAPH_H 0009 0010 #include <QtGlobal> 0011 #include <QScopedPointer> 0012 #include <language/languageexport.h> 0013 0014 class QString; 0015 0016 namespace KDevelop { 0017 class TopDUContext; 0018 class DUContext; 0019 class DumpDotGraphPrivate; 0020 0021 0022 /** 0023 * A helper-class for debugging, that nicely visualizes the whole structure of a du-context. 0024 * */ 0025 class KDEVPLATFORMLANGUAGE_EXPORT DumpDotGraph 0026 { 0027 Q_DISABLE_COPY(DumpDotGraph) 0028 0029 public: 0030 DumpDotGraph(); 0031 ~DumpDotGraph(); 0032 /** 0033 * The context, it's, and if it is not a top-context also all contexts importing it we be drawn. 0034 * Parent-contexts will not be respected, so if you want the whole structure, you will need to pass the top-context. 0035 * @param shortened if this is given sub-items like declarations, definitions, child-contexts, etc. will not be shown as separate nodes 0036 * */ 0037 QString dotGraph(KDevelop::DUContext* context, bool shortened = false); 0038 0039 private: 0040 const QScopedPointer<class DumpDotGraphPrivate> d_ptr; 0041 Q_DECLARE_PRIVATE(DumpDotGraph) 0042 }; 0043 } 0044 0045 #endif // KDEVPLATFORM_DUMPDOTGRAPH_H