GNU Octave
3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
A filter which matches URLs in blocks of text. More...
#include "Filter.h"
Classes | |
class | HotSpot |
Hotspot type created by UrlFilter instances. More... |
Public Member Functions | |
UrlFilter () | |
HotSpot * | hotSpotAt (int line, int column) const |
Adds a new line of text to the filter and increments the line count. | |
QList< HotSpot * > | hotSpots () const |
Returns the list of hotspots identified by the filter. | |
QList< HotSpot * > | hotSpotsAtLine (int line) const |
Returns the list of hotspots identified by the filter which occur on a given line. | |
virtual void | process () |
Reimplemented to search the filter's text buffer for text matching regExp() | |
QRegExp | regExp () const |
Returns the regular expression which the filter searches for in blocks of text. | |
void | reset () |
Empties the filters internal buffer and resets the line count back to 0. | |
void | setBuffer (const QString *buffer, const QList< int > *linePositions) |
TODO: Document me. | |
void | setRegExp (const QRegExp &text) |
Sets the regular expression which the filter searches for in blocks of text. |
Protected Member Functions | |
void | addHotSpot (HotSpot *) |
Adds a new hotspot to the list. | |
const QString * | buffer () |
Returns the internal buffer. | |
void | getLineColumn (int position, int &startLine, int &startColumn) |
Converts a character position within buffer() to a line and column. | |
virtual RegExpFilter::HotSpot * | newHotSpot (int, int, int, int) |
Called when a match for the regular expression is encountered. |
Static Private Attributes | |
static const QRegExp | CompleteUrlRegExp |
static const QRegExp | EmailAddressRegExp |
static const QRegExp | FullUrlRegExp |
UrlFilter::UrlFilter | ( | ) |
Definition at line 506 of file Filter.cpp.
References CompleteUrlRegExp, and RegExpFilter::setRegExp().
Adds a new hotspot to the list.
Definition at line 250 of file Filter.cpp.
References Filter::_hotspotList, and Filter::_hotspots.
Referenced by RegExpFilter::process().
|
protectedinherited |
Returns the internal buffer.
Definition at line 243 of file Filter.cpp.
References Filter::_buffer.
Referenced by RegExpFilter::process(), and Filter::setBuffer().
Converts a character position within buffer() to a line and column.
Definition at line 204 of file Filter.cpp.
References Filter::_buffer, and Filter::_linePositions.
Referenced by RegExpFilter::process().
|
inherited |
Adds a new line of text to the filter and increments the line count.
Returns the hotspot which covers the given line
and column
, or 0 if no hotspot covers that area
Definition at line 268 of file Filter.cpp.
References Filter::_hotspots, Filter::HotSpot::endColumn(), Filter::HotSpot::endLine(), Filter::HotSpot::startColumn(), and Filter::HotSpot::startLine().
Referenced by FilterChain::hotSpotAt().
|
inherited |
Returns the list of hotspots identified by the filter.
Definition at line 259 of file Filter.cpp.
References Filter::_hotspotList.
Referenced by FilterChain::hotSpots().
|
inherited |
Returns the list of hotspots identified by the filter which occur on a given line.
Definition at line 263 of file Filter.cpp.
References Filter::_hotspots.
|
protectedvirtual |
Called when a match for the regular expression is encountered.
Subclasses should reimplement this to return custom hotspot types
Reimplemented from RegExpFilter.
Definition at line 416 of file Filter.cpp.
|
virtualinherited |
Reimplemented to search the filter's text buffer for text matching regExp()
If regexp matches the empty string, then process() will return immediately without finding results.
Implements Filter.
Definition at line 363 of file Filter.cpp.
References RegExpFilter::_searchText, Filter::addHotSpot(), Filter::buffer(), Filter::getLineColumn(), and RegExpFilter::newHotSpot().
|
inherited |
Returns the regular expression which the filter searches for in blocks of text.
Definition at line 355 of file Filter.cpp.
References RegExpFilter::_searchText.
Referenced by RegExpFilter::setRegExp().
Empties the filters internal buffer and resets the line count back to 0.
All hotspots are deleted.
Definition at line 192 of file Filter.cpp.
References Filter::_hotspotList, and Filter::_hotspots.
TODO: Document me.
Definition at line 198 of file Filter.cpp.
References Filter::_buffer, Filter::_linePositions, and Filter::buffer().
|
inherited |
Sets the regular expression which the filter searches for in blocks of text.
Regular expressions which match the empty string are treated as not matching anything.
Definition at line 351 of file Filter.cpp.
References RegExpFilter::_searchText, and RegExpFilter::regExp().
Referenced by UrlFilter().
|
staticprivate |
Definition at line 293 of file Filter.h.
Referenced by UrlFilter().
|
staticprivate |
Definition at line 290 of file Filter.h.
Referenced by UrlFilter::HotSpot::urlType().
|
staticprivate |
Definition at line 289 of file Filter.h.
Referenced by UrlFilter::HotSpot::urlType().