C# Class SubLib.Core.Search.SearchOperator

Performs search operations.
Show file Open project: GNOME/gnome-subtitles Class Usage Examples

Public Methods

Method Description
Find ( SubtitleSearchOptions options ) : SubtitleSearchResults

Searches for text using the specified search options.

FindNearTime ( float time ) : int

Finds the subtitle more near of specified time position.

FindWithTime ( float time ) : int

Finds the subtitle that contains the specified time position.

ReplaceAll ( Regex regex, string replacement ) : ArrayList

Replaces all occurences of some text with the specified replacement.

The newline (\n) char is used as the line break.

ReplaceAll ( Regex regex, string replacement, string lineBreak ) : ArrayList

Replaces all occurences of some text with the specified replacement.

SearchOperator ( Subtitles subtitles ) : SubLib.Core.Domain

Private Methods

Method Description
FindBackward ( SubtitleSearchOptions options ) : SubtitleSearchResults

Searches backward for text using the specified search options.

FindForward ( SubtitleSearchOptions options ) : SubtitleSearchResults

Searches forward for text using the specified search options.

FindInSubtitle ( int subtitleNumber, string lineBreak, Regex regex, bool backwards ) : SubtitleSearchResults
FindInSubtitleFromIndex ( int subtitleNumber, string lineBreak, Regex regex, int startIndex, SubtitleTextType textType, bool backwards ) : SubtitleSearchResults
FindInSubtitleTillIndex ( int subtitleNumber, string lineBreak, Regex regex, int endIndex, SubtitleTextType textType, bool backwards ) : SubtitleSearchResults
FindInTextContent ( int subtitleNumber, string lineBreak, Regex regex, SubtitleTextType textType ) : SubtitleSearchResults
FindInTextContentFromIndex ( int subtitleNumber, string lineBreak, Regex regex, int startIndex, SubtitleTextType textType ) : SubtitleSearchResults
FindInTextContentTillIndex ( int subtitleNumber, string lineBreak, Regex regex, int endIndex, SubtitleTextType textType, bool backwards ) : SubtitleSearchResults
MatchValues ( Match match, int subtitleNumber, SubtitleTextType textType, int charsBeforeMatchInput ) : SubtitleSearchResults
ReplaceText ( string text, Regex regex, string replacement, MatchEvaluationCounter counter ) : string

Method Details

Find() public method

Searches for text using the specified search options.
public Find ( SubtitleSearchOptions options ) : SubtitleSearchResults
options SubtitleSearchOptions The search options.
return SubtitleSearchResults

FindNearTime() public method

Finds the subtitle more near of specified time position.
public FindNearTime ( float time ) : int
time float The time position, in seconds.
return int

FindWithTime() public method

Finds the subtitle that contains the specified time position.
public FindWithTime ( float time ) : int
time float The time position, in seconds.
return int

ReplaceAll() public method

Replaces all occurences of some text with the specified replacement.
The newline (\n) char is used as the line break.
public ReplaceAll ( Regex regex, string replacement ) : ArrayList
regex System.Text.RegularExpressions.Regex A regular expression used to find the text to be replaced.
replacement string The text that will be used as a replacement.
return System.Collections.ArrayList

ReplaceAll() public method

Replaces all occurences of some text with the specified replacement.
public ReplaceAll ( Regex regex, string replacement, string lineBreak ) : ArrayList
regex System.Text.RegularExpressions.Regex A regular expression used to find the text to be replaced.
replacement string The text that will be used as a replacement.
lineBreak string The line break to use between multiple lines of text in each subtitle.
return System.Collections.ArrayList

SearchOperator() public method

public SearchOperator ( Subtitles subtitles ) : SubLib.Core.Domain
subtitles SubLib.Core.Domain.Subtitles
return SubLib.Core.Domain