NVDA Helper
In-process and lite high-speed utilities for NVDA
|
Go to the source code of this file.
Typedefs | |
typedef std::multimap< std::wstring, std::wstring > | multiValueAttribsMap |
Functions | |
std::wstring | getNameForURL (const std::wstring &url) |
Obtain a user friendly name for a URL if possible. | |
bool | isWhitespace (const wchar_t *str) |
Determine whether a string of text is whitespace. | |
void | multiValueAttribsStringToMap (const std::wstring &attribsString, multiValueAttribsMap &attribsMap) |
Convert a multi-value attributes string to a multimap of attribute keys and values. | |
bool | nodeHasUsefulContent (VBufStorage_fieldNode_t *node) |
Determine whether a buffer node has useful content. | |
bool | nodeContentMatchesString (VBufStorage_fieldNode_t *node, const std::wstring &testStr) |
Determine whether a buffer node's description is the same as it's content. | |
bool | isPrivateCharacter (wchar_t ch) |
typedef std::multimap<std::wstring, std::wstring> multiValueAttribsMap |
std::wstring getNameForURL | ( | const std::wstring & | url | ) |
Obtain a user friendly name for a URL if possible.
This is done as follows: For a URL which is not path-based (e.g. javascript), return the URL with the protocol (the portion before the colon) stripped. For a path-based URL (e.g. http) or a URL with no protocol (which is assumed to be a path), modify the URL as follows:
url | The URL. |
Referenced by MshtmlVBufBackend_t::fillVBuf().
bool isWhitespace | ( | const wchar_t * | str | ) |
Determine whether a string of text is whitespace.
str | The string in question. @precondition: str is not NULL . |
true
if str
is whitespace, false
otherwise. void multiValueAttribsStringToMap | ( | const std::wstring & | attribsString, |
multiValueAttribsMap & | attribsMap ) |
Convert a multi-value attributes string to a multimap of attribute keys and values.
A multi-value attributes string is of the form "name:value;name:value1,value2;...;" Colons, commas and semi-colons must be escaped with a backslash character. An invalid attributes string does not cause an error, but strange results may be returned.
attribsString | The attributes string to convert. |
attribsMap | The multiValueAttribsMap into which the attributes should be placed, with keys and values as strings. |
bool nodeHasUsefulContent | ( | VBufStorage_fieldNode_t * | node | ) |
Determine whether a buffer node has useful content.
Useful content means the text isn't empty and isn't just a small amount of whitespace.
References VBufStorage_fieldNode_t::getLength(), VBufStorage_fieldNode_t::getTextInRange(), and isPrivateCharacter().
Referenced by MshtmlVBufBackend_t::fillVBuf().
bool nodeContentMatchesString | ( | VBufStorage_fieldNode_t * | node, |
const std::wstring & | testStr ) |
Determine whether a buffer node's description is the same as it's content.
This can happen with links that have a title attribute matching the content.
References VBufStorage_fieldNode_t::getLength(), and VBufStorage_fieldNode_t::getTextInRange().
|
inline |
Referenced by VBufStorage_buffer_t::addTextFieldNode(), and nodeHasUsefulContent().