Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Finder Class Reference

This class provides the functionality to search for a given search term in a data structure. More...

List of all members.

Public Member Functions

 Finder (Document *doc, QArray< int > *typefilter, const char *argument, bool ignoreCase)
 Creates a new finder with a new search term.

 ~Finder (void)
 Deletes this instance.

void findGenericNode (GenericNode *node, const NodeAddress &addrParent)
 Starts the search at the given node.

const NodeAddressfirst ()
 Retrieves the first node in the found list.

const NodeAddressnext ()
 Retrieves the next in the found list.


Private Member Functions

void findTypeNode (TypeNode *node, const NodeAddress &addrParent)
 Searches in a TypeNode.

void findStrucNode (StrucNode *node, const NodeAddress &addrParent)
 Searches in a StrucNode.

void findFeatvalNode (FeatvalNode *node, const NodeAddress &addrParent)
 Searches in a FeatvalNode.

void findListNode (ListNode *node, const NodeAddress &addrParent)
 Searches in a ListNode.

void findSetNode (SetNode *node, const NodeAddress &addrParent)
 Searches in a SetNode.

void findFunctionNode (FunctionNode *node, const NodeAddress &addrParent)
 Searches in a FunctionNode.

void findRefNode (RefNode *node, const NodeAddress &addrParent)
 Searches in a RefNode.

void findReentNode (ReentNode *node, const NodeAddress &addrParent)
 Searches in a ReentNode.

void findTreeNode (TreeNode *node, const NodeAddress &addrParent)
 Searches in a TreeNode.

void findAtomNode (AtomNode *node, const NodeAddress &addrParent)
 Searches in a AtomNode.

void findRelNode (RelationNode *node, const NodeAddress &addrParent)
 Searches in a RelNode.

void findTailNode (TailNode *node, const NodeAddress &addrParent)
 Searches in a TailNode.

void findRestNode (RestNode *node, const NodeAddress &addrParent)
 Searches in a RestNode.

void findDisjunctionNode (DisjunctionNode *node, const NodeAddress &addrParent)
 Searches within a DisjunctionNode.

void findConjunctionNode (ConjunctionNode *node, const NodeAddress &addrParent)
 Searches within a ConjunctionNode.

int strCmp (const char *s1, const char *s2)
 String compare that ignores case in the comparison depending on the value of ignoreCase.


Private Attributes

QList< NodeAddress > * foundList
 The list of addresses of nodes that match the search term.

char * argument
 The search term.

QArray< int > * typefilter
 An array that contains all types of nodes to be included in the next search.

Documentd
 The document that contains the data structure to be searched.

bool ignoreCase
 true if all string comparisons should ignore case, false otherwise.


Detailed Description

This class provides the functionality to search for a given search term in a data structure.

The node addresses of all nodes that match the search term are kept in a list. Using the built-in type filter, it is possible to selectively include and exclude nodes in or from the search based on their type.

Author:
Holger Wunsch


Constructor & Destructor Documentation

Finder::Finder Document doc,
QArray< int > *  typefilter,
const char *  argument,
bool  ignoreCase
 

Creates a new finder with a new search term.

Parameters:
doc the document which contains the data to be searched.
typefilter an array that contains all types of nodes that should be included in this search. The values of each element in the array must be set to one of the NODETYPE_xxxx constants.
argument the search term, an alphanumeric string
ignoreCase true makes the finder ignore case

Finder::~Finder void   ) 
 

Deletes this instance.


Member Function Documentation

void Finder::findAtomNode AtomNode node,
const NodeAddress addrParent
[private]
 

Searches in a AtomNode.

Parameters:
node the node
addrParent the address of this node's parent node.

void Finder::findConjunctionNode ConjunctionNode node,
const NodeAddress addrParent
[private]
 

Searches within a ConjunctionNode.

Parameters:
node the ConjunctionNode
addrParent the node address of the displayable parent node.

void Finder::findDisjunctionNode DisjunctionNode node,
const NodeAddress addrParent
[private]
 

Searches within a DisjunctionNode.

Parameters:
node the DisjunctionNode
addrParent the node address of the displayable parent node.

void Finder::findFeatvalNode FeatvalNode node,
const NodeAddress addrParent
[private]
 

Searches in a FeatvalNode.

Parameters:
node the node
addrParent the address of this node's parent node.

void Finder::findFunctionNode FunctionNode node,
const NodeAddress addrParent
[private]
 

Searches in a FunctionNode.

Parameters:
node the node
addrParent the address of this node's parent node.

void Finder::findGenericNode GenericNode node,
const NodeAddress addrParent
 

Starts the search at the given node.

After calling this function, the addresses of the found nodes can be retrieved with first() and next().

Parameters:
node the node where the search is started
addrParent this node's parent address.

void Finder::findListNode ListNode node,
const NodeAddress addrParent
[private]
 

Searches in a ListNode.

Parameters:
node the node
addrParent the address of this node's parent node.

void Finder::findReentNode ReentNode node,
const NodeAddress addrParent
[private]
 

Searches in a ReentNode.

Parameters:
node the node
addrParent the address of this node's parent node.

void Finder::findRefNode RefNode node,
const NodeAddress addrParent
[private]
 

Searches in a RefNode.

Parameters:
node the node
addrParent the address of this node's parent node.

void Finder::findRelNode RelationNode node,
const NodeAddress addrParent
[private]
 

Searches in a RelNode.

Parameters:
node the node
addrParent the address of this node's parent node.

void Finder::findRestNode RestNode node,
const NodeAddress addrParent
[private]
 

Searches in a RestNode.

Parameters:
node the node
addrParent the address of this node's parent node.

void Finder::findSetNode SetNode node,
const NodeAddress addrParent
[private]
 

Searches in a SetNode.

Parameters:
node the node
addrParent the address of this node's parent node.

void Finder::findStrucNode StrucNode node,
const NodeAddress addrParent
[private]
 

Searches in a StrucNode.

Parameters:
node the node
addrParent the address of this node's parent node.

void Finder::findTailNode TailNode node,
const NodeAddress addrParent
[private]
 

Searches in a TailNode.

Parameters:
node the node
addrParent the address of this node's parent node.

void Finder::findTreeNode TreeNode node,
const NodeAddress addrParent
[private]
 

Searches in a TreeNode.

Parameters:
node the node
addrParent the address of this node's parent node.

void Finder::findTypeNode TypeNode node,
const NodeAddress addrParent
[private]
 

Searches in a TypeNode.

Parameters:
node the node
addrParent the address of this node's parent node.

const NodeAddress * Finder::first  ) 
 

Retrieves the first node in the found list.

Returns:
the first node in the found list, or NULL if no node was found at all.

const NodeAddress * Finder::next  ) 
 

Retrieves the next in the found list.

Returns:
the next node in the found list, or NULL if no more nodes are in the found list.

int Finder::strCmp const char *  s1,
const char *  s2
[private]
 

String compare that ignores case in the comparison depending on the value of ignoreCase.

Parameters:
s1 the first string
s2 the second string
Returns:
the result of the comparison (either 0, < 0, or > 0; see the documentation of the strcmp and strcasecmp C-library routines).


Member Data Documentation

char* Finder::argument [private]
 

The search term.

Document* Finder::d [private]
 

The document that contains the data structure to be searched.

QList<NodeAddress>* Finder::foundList [private]
 

The list of addresses of nodes that match the search term.

bool Finder::ignoreCase [private]
 

true if all string comparisons should ignore case, false otherwise.

QArray<int>* Finder::typefilter [private]
 

An array that contains all types of nodes to be included in the next search.

Valid values for array elements are the NODETYPE_xxxx constants.


Generated on Sun Apr 27 18:26:57 2003 for Grisu by doxygen1.3