|
1 // tregexoptions.h |
|
2 // |
|
3 // Copyright (c) 2005 - 2006, Google Inc. |
|
4 // All rights reserved. |
|
5 // |
|
6 // Redistribution and use in source and binary forms, with or without |
|
7 // modification, are permitted provided that the following conditions are |
|
8 // met: |
|
9 // |
|
10 // * Redistributions of source code must retain the above copyright |
|
11 // notice, this list of conditions and the following disclaimer. |
|
12 // * Redistributions in binary form must reproduce the above |
|
13 // copyright notice, this list of conditions and the following disclaimer |
|
14 // in the documentation and/or other materials provided with the |
|
15 // distribution. |
|
16 // * Neither the name of Google Inc. nor the names of its |
|
17 // contributors may be used to endorse or promote products derived from |
|
18 // this software without specific prior written permission. |
|
19 // |
|
20 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
21 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
22 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
|
23 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
|
24 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
25 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
26 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
|
27 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
28 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
29 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|
30 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
31 // |
|
32 // Author: Sanjay Ghemawat |
|
33 // |
|
34 // Heavily refactored for Symbian OS by Accenture. |
|
35 |
|
36 #ifndef TREGEXOPTIONS_H_ |
|
37 #define TREGEXOPTIONS_H_ |
|
38 |
|
39 #include <e32base.h> |
|
40 |
|
41 enum TRegExOptionFlags |
|
42 { |
|
43 EPcreCaseless = 0x00000001, |
|
44 EPcreMultiline = 0x00000002, |
|
45 EPcreDotAll = 0x00000004, |
|
46 EPcreExtended = 0x00000008, |
|
47 EPcreAnchored = 0x00000010, |
|
48 EPcreDollarEndOnly = 0x00000020, |
|
49 EPcreExtra = 0x00000040, |
|
50 EPcreNotBol = 0x00000080, |
|
51 EPcreNotEol = 0x00000100, |
|
52 EPcreUngreedy = 0x00000200, |
|
53 EPcreNotEmpty = 0x00000400, |
|
54 EPcreUtf8 = 0x00000800, |
|
55 EPcreNoAutoCapture = 0x00001000, |
|
56 EPcreNoUtf8Check = 0x00002000, |
|
57 EPcreAutoCallout = 0x00004000, |
|
58 EPcrePartial = 0x00008000, |
|
59 EPcreDfaShortest = 0x00010000, |
|
60 EPcreDfaRestart = 0x00020000, |
|
61 EPcreFirstline = 0x00040000, |
|
62 EPcreDupnames = 0x00080000, |
|
63 EPcreNewlineCr = 0x00100000, |
|
64 EPcreNewlineLf = 0x00200000, |
|
65 EPcreNewlineCrLf = 0x00300000, |
|
66 EPcreNewlineAny = 0x00400000, |
|
67 EPcreNewlineAnyCrLf = 0x00500000, |
|
68 EPcreBsrAnyCrLf = 0x00800000, |
|
69 EPcreBsrUnicode = 0x01000000, |
|
70 EPcreJavascriptCompat = 0x02000000 |
|
71 }; |
|
72 |
|
73 class TRegExOptions |
|
74 { |
|
75 public: |
|
76 IMPORT_C TRegExOptions(); |
|
77 IMPORT_C TRegExOptions(TUint aOptionFlags); |
|
78 |
|
79 // Getters / Setters |
|
80 inline TInt MatchLimit() const; |
|
81 inline TRegExOptions SetMatchLimit(TInt aLimit); |
|
82 inline TInt MatchLimitRecursion() const; |
|
83 inline TRegExOptions SetMatchLimitRecursion(TInt aLimit); |
|
84 inline TInt AllOptions() const; |
|
85 inline TRegExOptions SetAllOptions(TInt aOptions); |
|
86 |
|
87 inline TBool Caseless() const; |
|
88 inline TRegExOptions SetCaseless(TBool aCaseLess); |
|
89 inline TBool Multiline() const; |
|
90 inline TRegExOptions SetMultiline(TBool aMultiline); |
|
91 inline TBool DotAll() const; |
|
92 inline TRegExOptions SetDotAll(TBool aDotAll); |
|
93 inline TBool Extended() const; |
|
94 inline TRegExOptions SetExtended(TBool aExtended); |
|
95 inline TBool DollarEndOnly() const; |
|
96 inline TRegExOptions SetDollarEndOnly(TBool aDollarEndOnly); |
|
97 inline TBool Extra() const; |
|
98 inline TRegExOptions SetExtra(TBool aSetExtra); |
|
99 inline TBool Ungreedy() const; |
|
100 inline TRegExOptions SetUngreedy(TBool aUngreedy); |
|
101 inline TBool Utf8() const; |
|
102 inline TRegExOptions SetUtf8(TBool aUtf8); |
|
103 inline TBool NoAutoCapture() const; |
|
104 inline TRegExOptions SetNoAutoCapture(TBool aAutoCapture); |
|
105 |
|
106 private: |
|
107 TInt iMatchLimit; |
|
108 TInt iMatchLimitRecursion; |
|
109 TUint iAllOptions; |
|
110 }; |
|
111 |
|
112 #include "tregexoptions.inl" |
|
113 #endif /* TREGEXOPTIONS_H_ */ |