NVDA Helper
In-process and lite high-speed utilities for NVDA
VBufStorage_textFieldNode_t Class Reference

a node that represents a field of text in a buffer. More...

#include <storage.h>

Inheritance diagram for VBufStorage_textFieldNode_t:
VBufStorage_fieldNode_t

Public Member Functions

virtual std::wstring getDebugInfo () const
 
- Public Member Functions inherited from VBufStorage_fieldNode_t
bool matchAttributes (const std::vector< std::wstring > &attribs, const std::wregex &regexp)
 work out if the attributes in the given string exist on this node.
 
VBufStorage_controlFieldNode_tgetParent ()
 points to this node's parent control field node.
 
VBufStorage_fieldNode_tgetPrevious ()
 points to the node directly before this node that shares the same parent as this node.
 
VBufStorage_fieldNode_tgetNext ()
 points to the node directly after this node that shares the same parent as this node.
 
VBufStorage_fieldNode_tgetFirstChild ()
 points to this node's first child.
 
VBufStorage_fieldNode_tgetLastChild ()
 points to this node's last child.
 
bool addAttribute (const std::wstring &name, const std::wstring &value)
 Adds an attribute to this field.
 
std::optional< std::wstring > getAttribute (const std::wstring &name)
 Gets an attribute value for this field.
 
std::wstring getAttributesString () const
 
int getLength ()
 Retreave the length of this node.
 

Public Attributes

const std::wstring text
 The text this field contains.
 
- Public Attributes inherited from VBufStorage_fieldNode_t
bool isBlock
 true if this field should cause a line break at its start and end when a buffer is calculating lines.
 
bool isHidden
 True if this node his hidden - searches will not locate this node.
 

Protected Member Functions

virtual VBufStorage_textFieldNode_tlocateTextFieldNodeAtOffset (int offset, int *relativeOffset)
 Locates the descendant textFieldNode that is positioned at the given offset in this node.
 
virtual void generateMarkupTagName (std::wstring &text)
 generates this field's markup tag name
 
virtual void getTextInRange (int startOffset, int endOffset, std::wstring &text, bool useMarkup=false, bool(*filter)(VBufStorage_fieldNode_t *)=NULL)
 fetches the text between given offsets in this node and its descendants, with optional markup.
 
 VBufStorage_textFieldNode_t (const std::wstring &text)
 constructor.
 
- Protected Member Functions inherited from VBufStorage_fieldNode_t
VBufStorage_fieldNode_tnextNodeInTree (int direction, VBufStorage_fieldNode_t *limitNode, int *relativeStartOffset)
 moves to the next node, in depth-first order.
 
int calculateOffsetInTree () const
 Calculates the offset for this node relative to the surrounding tree.
 
virtual void generateAttributesForMarkupOpeningTag (std::wstring &text, int startOffset, int endOffset)
 Generates the attributes within a markup opening tag.
 
void generateMarkupOpeningTag (std::wstring &text, int startOffset, int endOffset)
 generates a markup opening tag for this field.
 
void generateMarkupClosingTag (std::wstring &text)
 generates a markup closing tag for this field.
 
virtual void disassociateFromBuffer (VBufStorage_buffer_t *buffer)
 Disassociates this node from its buffer.
 
 VBufStorage_fieldNode_t (int length, bool isBlock)
 constructor.
 
virtual ~VBufStorage_fieldNode_t ()
 destructor
 

Friends

class VBufStorage_buffer_t
 

Additional Inherited Members

- Protected Attributes inherited from VBufStorage_fieldNode_t
VBufStorage_controlFieldNode_tparent
 points to this node's parent control field node.
 
VBufStorage_fieldNode_tprevious
 points to the node directly before this node that shares the same parent as this node.
 
VBufStorage_fieldNode_tnext
 points to the node directly after this node that shares the same parent as this node.
 
VBufStorage_fieldNode_tfirstChild
 points to this node's first child.
 
VBufStorage_fieldNode_tlastChild
 points to this node's last child.
 
int length
 The length of this node in characters.
 
VBufStorage_attributeMap_t attributes
 a map to hold attributes for this field.
 

Detailed Description

a node that represents a field of text in a buffer.

It holds the actual text it represents, and also sets its length accordingly.

Constructor & Destructor Documentation

◆ VBufStorage_textFieldNode_t()

VBufStorage_textFieldNode_t::VBufStorage_textFieldNode_t ( const std::wstring & text)
protected

constructor.

Parameters
textthe text this field should contain.

References VBufStorage_fieldNode_t::length, and LOG_DEBUG.

Member Function Documentation

◆ locateTextFieldNodeAtOffset()

VBufStorage_textFieldNode_t * VBufStorage_textFieldNode_t::locateTextFieldNodeAtOffset ( int offset,
int * relativeOffset )
protectedvirtual

Locates the descendant textFieldNode that is positioned at the given offset in this node.

Parameters
offsetthe offset with in this node.
relativeOffsetmemory where the offset relative to the found node can be placed
Returns
the descendant textFieldNode at that offset, or NULL if none there.

Reimplemented from VBufStorage_fieldNode_t.

References VBufStorage_fieldNode_t::length, LOG_DEBUG, and nhAssert.

Referenced by VBufStorage_fieldNode_t::locateTextFieldNodeAtOffset().

◆ generateMarkupTagName()

void VBufStorage_textFieldNode_t::generateMarkupTagName ( std::wstring & text)
protectedvirtual

generates this field's markup tag name

Parameters
textwhere to place the generated name

Implements VBufStorage_fieldNode_t.

References text.

◆ getTextInRange()

void VBufStorage_textFieldNode_t::getTextInRange ( int startOffset,
int endOffset,
std::wstring & text,
bool useMarkup = false,
bool(* filter )(VBufStorage_fieldNode_t *) = NULL )
protectedvirtual

fetches the text between given offsets in this node and its descendants, with optional markup.

Parameters
startOffsetthe offset to start from.
endOffsetthe offset to end at. Use -1 to mean node's end offset.
texta string in whish to append the text.
useMarkupif true then markup indicating opening and closing of fields will be included.
filtera function that takes the current recursive node and returns true if text should be fetched and false if it should be skipped.
Returns
true if successfull, false otherwize.

Reimplemented from VBufStorage_fieldNode_t.

References appendCharToXML(), VBufStorage_fieldNode_t::generateMarkupClosingTag(), VBufStorage_fieldNode_t::generateMarkupOpeningTag(), VBufStorage_fieldNode_t::length, LOG_DEBUG, nhAssert, and text.

◆ getDebugInfo()

std::wstring VBufStorage_textFieldNode_t::getDebugInfo ( ) const
virtual
Returns
a string providing information about this node's type, and its state.

Reimplemented from VBufStorage_fieldNode_t.

References VBufStorage_fieldNode_t::getDebugInfo().

Referenced by VBufStorage_buffer_t::addTextFieldNode().

Friends And Related Symbol Documentation

◆ VBufStorage_buffer_t

friend class VBufStorage_buffer_t
friend

Member Data Documentation

◆ text

const std::wstring VBufStorage_textFieldNode_t::text

The text this field contains.

Referenced by generateMarkupTagName(), and getTextInRange().


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