• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • KDevelop Platform Libraries
  • Sitemap
  • Contact Us
 

language/duchain

codemodel.h

00001 /* This file is part of KDevelop
00002     Copyright 2008 David Nolden <david.nolden.kdevelop@art-master.de>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
00017 */
00018 
00019 #ifndef CODEMODEL_H
00020 #define CODEMODEL_H
00021 
00022 #include "identifier.h"
00023 
00024 namespace KDevelop {
00025 
00026   class Declaration;
00027   class IndexedDeclaration;
00028   class DeclarationId;
00029   class TopDUContext;
00030   class QualifiedIdentifier;
00031   class IndexedString;
00032   
00033 
00034   struct CodeModelItem {
00035     CodeModelItem() : referenceCount(0), kind(Unknown) {
00036     }
00037     enum Kind {
00038       Unknown = 0,
00039       Function = 1,
00040       Variable = 2,
00041       Class = 4,
00042       ForwardDeclaration = 8,
00043       Namespace = 16
00044     };
00045     IndexedQualifiedIdentifier id;
00046     uint referenceCount;
00047     union {
00048       Kind kind;
00049       uint uKind;
00050     };
00051     bool operator<(const CodeModelItem& rhs) const {
00052       return id < rhs.id;
00053     }
00054   };
00055   
00059   class KDEVPLATFORMLANGUAGE_EXPORT CodeModel {
00060     public:
00062     CodeModel();
00064     ~CodeModel();
00065 
00068     void addItem(const IndexedString& file, const IndexedQualifiedIdentifier& id, CodeModelItem::Kind kind);
00069 
00070     void removeItem(const IndexedString& file, const IndexedQualifiedIdentifier& id);
00071 
00073     void updateItem(const IndexedString& file, const IndexedQualifiedIdentifier& id, CodeModelItem::Kind kind);
00074     
00080     void items(const IndexedString& file, uint& count, const CodeModelItem*& items) const;
00081 
00082     static CodeModel& self();
00083     
00084     private:
00085       class CodeModelPrivate* d;
00086   };
00087 }
00088 
00089 #endif

language/duchain

Skip menu "language/duchain"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDevelop Platform Libraries

Skip menu "KDevelop Platform Libraries"
  • interfaces
  • language
  •   codegen
  •   duchain
  •   editor
  • outputview
  • project
  • shell
  • sublime
  • util
  • vcs
Generated for KDevelop Platform Libraries by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal