sword::TreeKeyIdx Class Reference

Class TreeKeyIdx The TreeKey implementation used for all tree-based modules in Sword, such as GenBooks. More...

#include <treekeyidx.h>

Inheritance diagram for sword::TreeKeyIdx:

Inheritance graph
[legend]
Collaboration diagram for sword::TreeKeyIdx:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TreeKeyIdx (const TreeKeyIdx &ikey)
 TreeKeyIdx (const char *idxPath, int fileMode=-1)
virtual SWKeyclone () const
 Returns a new exact clone of this SWKey object.
virtual const char * getLocalName ()
virtual const char * setLocalName (const char *)
virtual const char * getUserData (int *size=0)
virtual void setUserData (const char *userData, int size=0)
virtual void root ()
 Go to the root node.
virtual bool parent ()
 Go to the parent of the current node.
virtual bool firstChild ()
 Go to the first child of the current node.
virtual bool nextSibling ()
 Go to the next sibling of the current node.
virtual bool previousSibling ()
 Go to the previous sibling of the current node.
virtual bool hasChildren ()
 Does the current node have children?
virtual void append ()
virtual void appendChild ()
virtual void insertBefore ()
virtual void remove ()
virtual void save ()
virtual void copyFrom (const TreeKeyIdx &ikey)
virtual void copyFrom (const SWKey &ikey)
 Copies as much info (position, range, etc.
void setOffset (unsigned long offset)
unsigned long getOffset () const
virtual SWKeyoperator= (const TreeKeyIdx &ikey)
SWKeyoperator= (const char *ikey)
SWKeyoperator= (const SWKey &ikey)
SWKeyoperator= (SW_POSITION pos)
 operator const char * () const
bool operator== (const SWKey &ikey)
bool operator!= (const SWKey &ikey)
virtual bool operator> (const SWKey &ikey)
virtual bool operator< (const SWKey &ikey)
virtual bool operator>= (const SWKey &ikey)
virtual bool operator<= (const SWKey &ikey)
SWKeyoperator-= (int steps)
SWKeyoperator+= (int steps)
SWKeyoperator++ (int)
SWKeyoperator-- (int)
virtual void setText (const char *ikey)
 Sets this SWKey with a character string.
virtual void setPosition (SW_POSITION p)
virtual const char * getText () const
 returns string representation of this key
virtual int _compare (const TreeKeyIdx &ikey)
virtual int compare (const SWKey &ikey)
 Compares this key object to another SWKey object.
virtual void decrement (int steps=1)
 Decrements key a number of entry positions This is only valid if isTraversable is true.
virtual void increment (int steps=1)
 Increments key a number of entry positions This is only valid if isTraversable is true.
virtual bool isTraversable () const
 Whether or not this key can be ++ -- incremented.

Static Public Member Functions

static signed char create (const char *path)

Private Member Functions

void getTreeNodeFromDatOffset (long ioffset, TreeNode *buf) const
char getTreeNodeFromIdxOffset (long ioffset, TreeNode *node) const
void saveTreeNode (TreeNode *node)
void saveTreeNodeOffsets (TreeNode *node)
void init ()

Private Attributes

sword::TreeKeyIdx::TreeNode currentNode
char * path
FileDescidxfd
FileDescdatfd

Static Private Attributes

static SWClass classdef

Classes

class  TreeNode

Detailed Description

Class TreeKeyIdx The TreeKey implementation used for all tree-based modules in Sword, such as GenBooks.

Definition at line 37 of file treekeyidx.h.


Member Function Documentation

virtual SWKey* sword::TreeKeyIdx::clone (  )  const [virtual]

Returns a new exact clone of this SWKey object.

This allocates a new SWKey which must be deleted by the caller

Returns:
new clone of this key

Reimplemented from sword::SWKey.

virtual bool sword::TreeKeyIdx::parent (  )  [virtual]

Go to the parent of the current node.

Returns:
success or failure

Implements sword::TreeKey.

virtual bool sword::TreeKeyIdx::firstChild (  )  [virtual]

Go to the first child of the current node.

Returns:
success or failure

Implements sword::TreeKey.

virtual bool sword::TreeKeyIdx::nextSibling (  )  [virtual]

Go to the next sibling of the current node.

Returns:
success or failure

Implements sword::TreeKey.

virtual bool sword::TreeKeyIdx::previousSibling (  )  [virtual]

Go to the previous sibling of the current node.

Returns:
success or failure

Implements sword::TreeKey.

virtual bool sword::TreeKeyIdx::hasChildren (  )  [virtual]

Does the current node have children?

Returns:
whether or not it does

Implements sword::TreeKey.

virtual void sword::TreeKeyIdx::copyFrom ( const SWKey ikey  )  [virtual]

Copies as much info (position, range, etc.

) as possible from another SWKey object

Parameters:
ikey other SWKey object from which to copy

Reimplemented from sword::SWKey.

virtual void sword::TreeKeyIdx::setText ( const char *  ikey  )  [virtual]

Sets this SWKey with a character string.

Parameters:
ikey string used to set this key

Implements sword::TreeKey.

virtual int sword::TreeKeyIdx::compare ( const SWKey ikey  )  [virtual]

Compares this key object to another SWKey object.

Parameters:
ikey key to compare with this one
Returns:
>0 if this key is greater than compare key; <0 if this key is smaller than compare key; 0 if the keys are the same

Implements sword::TreeKey.

virtual void sword::TreeKeyIdx::decrement ( int  steps = 1  )  [virtual]

Decrements key a number of entry positions This is only valid if isTraversable is true.

Parameters:
steps Number of entries to jump backward

Implements sword::TreeKey.

virtual void sword::TreeKeyIdx::increment ( int  steps = 1  )  [virtual]

Increments key a number of entry positions This is only valid if isTraversable is true.

Parameters:
steps Number of entries to jump forward

Implements sword::TreeKey.


The documentation for this class was generated from the following file: