KDevelop API Documentation

languages/cpp/cppsupport_utils.cpp

Go to the documentation of this file.
00001 00002 #include "cppsupport_utils.h" 00003 #include <codemodel.h> 00004 #include <qdir.h> 00005 00006 static void typeNameList( QStringList& path, QStringList & lst, const CodeModel * model ); 00007 static void typeNameList( QStringList& path, QStringList & lst, NamespaceDom ns ); 00008 static void typeNameList( QStringList & path, QStringList & lst, ClassDom klass ); 00009 00010 QStringList typeNameList( const CodeModel* model ) 00011 { 00012 QStringList lst; 00013 QStringList path; 00014 typeNameList( path, lst, model ); 00015 return lst; 00016 } 00017 00018 static void typeNameList( QStringList& path, QStringList & lst, const CodeModel * model ) 00019 { 00020 const FileList fileList = model->fileList(); 00021 for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it ) 00022 typeNameList( path, lst, model_cast<NamespaceDom>(*it) ); 00023 } 00024 00025 static void typeNameList( QStringList& path, QStringList & lst, NamespaceDom ns ) 00026 { 00027 if( !ns->isFile() ) 00028 path.push_back( ns->name() ); 00029 00030 const NamespaceList namespaceList = ns->namespaceList(); 00031 for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it ) 00032 typeNameList( path, lst, *it ); 00033 00034 const ClassList classList = ns->classList(); 00035 for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it ) 00036 typeNameList( path, lst, *it ); 00037 00038 if( !ns->isFile() ) 00039 path.pop_back(); 00040 } 00041 00042 static void typeNameList( QStringList & path, QStringList & lst, ClassDom klass ) 00043 { 00044 path.push_back( klass->name() ); 00045 00046 lst << path.join( "::" ); 00047 00048 const ClassList classList = klass->classList(); 00049 for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it ) 00050 typeNameList( path, lst, *it ); 00051 path.pop_back(); 00052 }
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 6 17:39:01 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003