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

language/duchain

KDevelop::DUContext::SearchItem

KDevelop::DUContext::SearchItem Struct Reference

Represents multiple qualified identifiers in a way that is better to manipulate and allows applying namespace-aliases or -imports easily. More...

#include <ducontext.h>

Inherits KShared.

List of all members.

Public Types

typedef KSharedPtr< SearchItem > Ptr
typedef KDevVarLengthArray
< Ptr, 256 > 
PtrList

Public Member Functions

 SearchItem (bool explicitlyGlobal, Identifier id, Ptr nextItem)
 SearchItem (bool explicitlyGlobal, Identifier id, const PtrList &nextItems)
 SearchItem (const QualifiedIdentifier &id, const PtrList &nextItems, int start=0)
 SearchItem (const QualifiedIdentifier &id, Ptr nextItem=Ptr(), int start=0)
void addNext (Ptr other)
void addToEachNode (PtrList items)
void addToEachNode (Ptr item)
bool hasNext () const
bool isEmpty () const
bool match (const QualifiedIdentifier &id, int offset=0) const
QList< QualifiedIdentifier > toList (const QualifiedIdentifier &prefix=QualifiedIdentifier()) const

Public Attributes

Identifier identifier
bool isExplicitlyGlobal
PtrList next

Detailed Description

Represents multiple qualified identifiers in a way that is better to manipulate and allows applying namespace-aliases or -imports easily.

A SearchItem generally represents a tree of identifiers, and represents all the qualified identifiers that can be constructed by walking along the tree starting at an arbitrary root-node into the depth using the "next" pointers. The insertion order in the hierarchy determines the order of the represented list.

Definition at line 727 of file ducontext.h.


Constructor & Destructor Documentation

KDevelop::DUContext::SearchItem::SearchItem ( const QualifiedIdentifier &  id,
Ptr  nextItem = Ptr(),
int  start = 0 
)

Constructs a representation of the given.

Todo:
find out why this KDevVarLengthArray crashes when it's resized!
Parameters:
id qualified identifier, starting at its index
start 
nextItem is set as next item to the last item in the chain

If there is no prefix, just copy nextItem

Definition at line 1814 of file ducontext.cpp.

KDevelop::DUContext::SearchItem::SearchItem ( const QualifiedIdentifier &  id,
const PtrList &  nextItems,
int  start = 0 
)

Constructs a representation of the given.

Parameters:
id qualified identifier, starting at its index
start 
nextItem is set as next item to the last item in the chain

Definition at line 1831 of file ducontext.cpp.


Member Function Documentation

void KDevelop::DUContext::SearchItem::addToEachNode ( SearchItem::Ptr  other  ) 

Appends the given item to every item that can be reached from this item(Not only to the end items) The effect to search is that the given item is searched with all prefixes contained in this earch-item prepended.

Warning:
This changes all contained sub-nodes, but they can be shared with other SearchItem trees. You should not use this on SearchItem trees that have shared nodes with other trees. These functions ignore explicitly global items.

Definition at line 1904 of file ducontext.cpp.

bool KDevelop::DUContext::SearchItem::match ( const QualifiedIdentifier &  id,
int  offset = 0 
) const

Returns true if the given identifier matches one of the identifiers represented by this SearchItem. Does not respect the explicitlyGlobal flag.

Definition at line 1848 of file ducontext.cpp.


The documentation for this struct was generated from the following files:
  • ducontext.h
  • ducontext.cpp

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