summaryrefslogtreecommitdiffstats
path: root/mimelib/doc/boyermor.html
blob: 12606e35018f03d90aee8c18ff43cd47a6e5ad6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<HTML>
<HEAD>
  <TITLE> DwBoyerMoore Man Page </TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H2>
  <FONT COLOR="navy"> NAME </FONT>
</H2>
<P>
DwBoyerMoore -- Class for executing Boyer-Moore string search algorithm
<H2>
  <FONT COLOR="navy"> SYNOPSIS </FONT>
</H2>
<PRE>class DW_EXPORT DwBoyerMoore {

public:

    <A HREF="boyermor.html#DwBoyerMoore">DwBoyerMoore</A>(const char* aCstr);
    <A HREF="boyermor.html#DwBoyerMoore">DwBoyerMoore</A>(const DwString&amp; aStr);
    virtual ~DwBoyerMoore();
    void <A HREF="boyermor.html#Assign">Assign</A>(const char* aCstr);
    void <A HREF="boyermor.html#Assign">Assign</A>(const DwString&amp; aStr);
    size_t <A HREF="boyermor.html#FindIn">FindIn</A>(const DwString&amp; aStr, size_t aPos);
};
</PRE>
<H2>
  <FONT COLOR="navy"> DESCRIPTION </FONT>
</H2>
<P>
<B><TT>DwBoyerMoore</TT></B> implements the Boyer-Moore algorithm for searching
for a string. The Boyer-Moore algorithm is fast, but requires a bit of start-up
overhead compared to a brute force algorithm.
<H2>
  <FONT COLOR="navy"> Public Member Functions </FONT>
</H2>
<P>
<FONT COLOR="teal"><B> <A NAME="DwBoyerMoore">DwBoyerMoore</A>(const char*
aCstr) <BR>
DwBoyerMoore(const DwString&amp; aStr) </B></FONT>
<P>
Constructs a <B><TT>DwBoyerMoore</TT></B> object for searching for a particular
string.
<P>
<FONT COLOR="teal"><B> void <A NAME="Assign">Assign</A>(const char* aCstr)
<BR>
void Assign(const DwString&amp; aStr) </B></FONT>
<P>
Sets the string to search for.
<P>
<FONT COLOR="teal"><B> size_t <A NAME="FindIn">FindIn</A>(const DwString&amp;
aStr, size_t aPos) </B></FONT>
<P>
Searches for the search string in <B><TT>aStr</TT></B> starting at position
<B><TT>aPos</TT></B>. If found, the function returns the first position in
<B><TT>aStr</TT></B> where the search string was found. If not found, the
function returns <B><TT>DwString::npos</TT></B>.
</BODY></HTML>