| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | ##-*- Mode: CPerl -*- | 
| 2 |  |  |  |  |  |  |  | 
| 3 |  |  |  |  |  |  | ##====================================================================== | 
| 4 |  |  |  |  |  |  | ## top-level | 
| 5 |  |  |  |  |  |  | package DDC::PP::CQFilter; | 
| 6 | 20 |  |  | 20 |  | 149 | use DDC::PP::Object; | 
|  | 20 |  |  |  |  | 44 |  | 
|  | 20 |  |  |  |  | 594 |  | 
| 7 | 20 |  |  | 20 |  | 109 | use DDC::PP::Constants; | 
|  | 20 |  |  |  |  | 38 |  | 
|  | 20 |  |  |  |  | 375 |  | 
| 8 | 20 |  |  | 20 |  | 96 | use DDC::Utils qw(); | 
|  | 20 |  |  |  |  | 36 |  | 
|  | 20 |  |  |  |  | 281 |  | 
| 9 | 20 |  |  | 20 |  | 88 | use strict; | 
|  | 20 |  |  |  |  | 39 |  | 
|  | 20 |  |  |  |  | 505 |  | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  | ##====================================================================== | 
| 12 |  |  |  |  |  |  | ## CQFilter | 
| 13 |  |  |  |  |  |  | package DDC::PP::CQFilter; | 
| 14 | 20 |  |  | 20 |  | 105 | use strict; | 
|  | 20 |  |  |  |  | 34 |  | 
|  | 20 |  |  |  |  | 2261 |  | 
| 15 |  |  |  |  |  |  | our @ISA = qw(DDC::PP::Object); | 
| 16 |  |  |  |  |  |  |  | 
| 17 |  |  |  |  |  |  | sub new { | 
| 18 | 28 |  |  | 28 | 0 | 125 | my ($that,%opts) = @_; | 
| 19 | 28 |  |  |  |  | 172 | return $that->SUPER::new(%opts); | 
| 20 |  |  |  |  |  |  | } | 
| 21 |  |  |  |  |  |  |  | 
| 22 | 0 |  |  | 0 | 0 | 0 | sub toString { return "#FILTER[?]"; } | 
| 23 |  |  |  |  |  |  |  | 
| 24 |  |  |  |  |  |  | ##====================================================================== | 
| 25 |  |  |  |  |  |  | package DDC::PP::CQFSort; | 
| 26 | 20 |  |  | 20 |  | 141 | use strict; | 
|  | 20 |  |  |  |  | 40 |  | 
|  | 20 |  |  |  |  | 12601 |  | 
| 27 |  |  |  |  |  |  | our @ISA = qw(DDC::PP::CQFilter); | 
| 28 |  |  |  |  |  |  |  | 
| 29 |  |  |  |  |  |  | __PACKAGE__->defprop('Arg0'); | 
| 30 |  |  |  |  |  |  | __PACKAGE__->defprop('Arg1'); | 
| 31 |  |  |  |  |  |  | __PACKAGE__->defprop('Arg2'); | 
| 32 |  |  |  |  |  |  | __PACKAGE__->defprop('Type'); | 
| 33 |  |  |  |  |  |  |  | 
| 34 | 0 |  |  | 0 |  | 0 | sub defaultSort { return 'NoSort'; } | 
| 35 |  |  |  |  |  |  | sub new { | 
| 36 | 28 |  |  | 28 |  | 95 | my ($that,$sort,$arg0,$arg1,$arg2,%opts) = @_; | 
| 37 | 28 | 100 |  |  |  | 209 | return $that->SUPER::new(Type=>(defined($sort) ? $sort : $DDC::PP::HitSortEnum{$that->defaultSort}), | 
| 38 |  |  |  |  |  |  | Arg0=>$arg0, | 
| 39 |  |  |  |  |  |  | Arg1=>$arg1, | 
| 40 |  |  |  |  |  |  | Arg2=>$arg2, | 
| 41 |  |  |  |  |  |  | %opts); | 
| 42 |  |  |  |  |  |  | } | 
| 43 |  |  |  |  |  |  | sub new_i { | 
| 44 | 0 |  |  | 0 |  | 0 | my ($that,$sort,$arg0,$arg1,$arg2,%opts) = @_; | 
| 45 | 0 |  |  |  |  | 0 | return $that->new($sort,$arg0,($arg1+0),($arg2+0),%opts); | 
| 46 |  |  |  |  |  |  | } | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  | sub argString { | 
| 49 | 6 | 50 | 33 | 6 |  | 39 | return !defined($_[1]) || $_[1] eq '' ? '' : DDC::Utils::escapeq($_[1]); | 
| 50 |  |  |  |  |  |  | } | 
| 51 |  |  |  |  |  |  | sub argStringE { | 
| 52 | 16 | 50 |  | 16 |  | 65 | return DDC::Utils::escapeq(defined($_[1]) ? $_[1] : ''); | 
| 53 |  |  |  |  |  |  | } | 
| 54 |  |  |  |  |  |  | sub toString { | 
| 55 | 6 |  |  | 6 |  | 18 | my $f = shift; | 
| 56 |  |  |  |  |  |  | my $args = join(',', | 
| 57 |  |  |  |  |  |  | ($f->{Arg0} ? $f->{Arg0} : qw()), | 
| 58 |  |  |  |  |  |  | ($f->{Arg1} || $f->{Arg2} | 
| 59 |  |  |  |  |  |  | ? ((defined($f->{Arg1}) ? $f->{Arg1} : ''), | 
| 60 | 6 | 50 | 66 |  |  | 86 | (defined($f->{Arg2}) ? $f->{Arg2} : '')) | 
|  |  | 50 |  |  |  |  |  | 
|  |  | 50 |  |  |  |  |  | 
|  |  | 100 |  |  |  |  |  | 
| 61 |  |  |  |  |  |  | : qw()) | 
| 62 |  |  |  |  |  |  | ); | 
| 63 | 6 | 100 |  |  |  | 101 | return '#'.uc($DDC::PP::HitSortEnumStrings[$f->{Type}]).($args ? "[$args]" : ''); | 
| 64 |  |  |  |  |  |  | } | 
| 65 |  |  |  |  |  |  |  | 
| 66 | 12 |  |  | 12 |  | 64 | sub jsonType { return (FilterType=>$DDC::PP::HitSortEnumStrings[$_[0]{Type}]); } | 
| 67 | 12 |  |  | 12 |  | 102 | sub jsonMinMax { return (Min=>$_[0]{Arg1}, Max=>$_[0]{Arg2}); } | 
| 68 | 12 |  |  | 12 |  | 47 | sub jsonData { return ($_[0]->jsonType, $_[0]->jsonMinMax); } | 
| 69 |  |  |  |  |  |  |  | 
| 70 |  |  |  |  |  |  | ##-- ddc-compatible hash-conversion (for toJson()) | 
| 71 |  |  |  |  |  |  | sub toHash { | 
| 72 | 12 |  |  | 12 |  | 30 | my ($obj,%opts) = @_; | 
| 73 | 12 | 50 |  |  |  | 30 | return $obj->SUPER::toHash(%opts) if (!$opts{json}); | 
| 74 | 12 |  |  |  |  | 38 | return { class=>$obj->jsonClass, $obj->jsonData }; | 
| 75 |  |  |  |  |  |  | } | 
| 76 |  |  |  |  |  |  |  | 
| 77 |  |  |  |  |  |  | ##-- pseudo-accessors (for json) | 
| 78 |  |  |  |  |  |  | __PACKAGE__->defalias('Min'=>'Arg1', 0,1); | 
| 79 |  |  |  |  |  |  | __PACKAGE__->defalias('Max'=>'Arg2', 0,1); | 
| 80 |  |  |  |  |  |  | #sub getFilterType { return $DDC::PP::HitSortEnumStrings[$_[0]{Type}]; } | 
| 81 | 0 |  |  | 0 |  | 0 | sub setFilterType { return $_[0]{Type} = $DDC::PP::HitSortEnum{$_[1]}; } | 
| 82 |  |  |  |  |  |  |  | 
| 83 |  |  |  |  |  |  |  | 
| 84 |  |  |  |  |  |  | ##====================================================================== | 
| 85 |  |  |  |  |  |  | ## CQFRankSort | 
| 86 |  |  |  |  |  |  | package DDC::PP::CQFRankSort; | 
| 87 | 20 |  |  | 20 |  | 182 | use strict; | 
|  | 20 |  |  |  |  | 51 |  | 
|  | 20 |  |  |  |  | 1747 |  | 
| 88 |  |  |  |  |  |  | our @ISA = qw(DDC::PP::CQFSort); | 
| 89 |  |  |  |  |  |  |  | 
| 90 | 0 |  |  | 0 |  | 0 | sub defaultSort { return 'GreaterByRank'; } | 
| 91 | 0 |  |  | 0 |  | 0 | sub jsonMinMax { return qw(); } | 
| 92 |  |  |  |  |  |  |  | 
| 93 |  |  |  |  |  |  | ##====================================================================== | 
| 94 |  |  |  |  |  |  | ## CQFDateSort | 
| 95 |  |  |  |  |  |  | package DDC::PP::CQFDateSort; | 
| 96 | 20 |  |  | 20 |  | 168 | use strict; | 
|  | 20 |  |  |  |  | 51 |  | 
|  | 20 |  |  |  |  | 2433 |  | 
| 97 |  |  |  |  |  |  | our @ISA = qw(DDC::PP::CQFSort); | 
| 98 |  |  |  |  |  |  |  | 
| 99 | 0 |  |  | 0 |  | 0 | sub defaultSort { return 'LessByDate' }; | 
| 100 |  |  |  |  |  |  | sub new { | 
| 101 | 16 |  |  | 16 |  | 47 | my ($that,$ftype,$lb,$ub,%opts) = @_; | 
| 102 | 16 |  |  |  |  | 96 | return $that->SUPER::new($ftype,'',$lb,$ub,%opts); | 
| 103 |  |  |  |  |  |  | } | 
| 104 |  |  |  |  |  |  |  | 
| 105 |  |  |  |  |  |  | ##====================================================================== | 
| 106 |  |  |  |  |  |  | ## CQFSizeSort | 
| 107 |  |  |  |  |  |  | package DDC::PP::CQFSizeSort; | 
| 108 | 20 |  |  | 20 |  | 138 | use strict; | 
|  | 20 |  |  |  |  | 37 |  | 
|  | 20 |  |  |  |  | 2117 |  | 
| 109 |  |  |  |  |  |  | our @ISA = qw(DDC::PP::CQFSort); | 
| 110 |  |  |  |  |  |  |  | 
| 111 | 0 |  |  | 0 |  | 0 | sub defaultSort { return 'LessBySize'; } | 
| 112 |  |  |  |  |  |  | sub new { | 
| 113 | 0 |  |  | 0 |  | 0 | my ($that,$ftype,$lb,$ub,%opts) = @_; | 
| 114 | 0 |  |  |  |  | 0 | return $that->SUPER::new($ftype,'',$lb,$ub,%opts); | 
| 115 |  |  |  |  |  |  | } | 
| 116 |  |  |  |  |  |  |  | 
| 117 |  |  |  |  |  |  | ##====================================================================== | 
| 118 |  |  |  |  |  |  | ## CQFRandomSort | 
| 119 |  |  |  |  |  |  | package DDC::PP::CQFRandomSort; | 
| 120 | 20 |  |  | 20 |  | 141 | use strict; | 
|  | 20 |  |  |  |  | 38 |  | 
|  | 20 |  |  |  |  | 3505 |  | 
| 121 |  |  |  |  |  |  | our @ISA = qw(DDC::PP::CQFSort); | 
| 122 |  |  |  |  |  |  |  | 
| 123 | 0 |  |  | 0 |  | 0 | sub defaultSort { return 'RandomSort'; } | 
| 124 |  |  |  |  |  |  | sub new { | 
| 125 | 0 |  |  | 0 |  | 0 | my ($that,$seed,%opts) = @_; | 
| 126 | 0 |  |  |  |  | 0 | return $that->SUPER::new(undef,'',$seed,'',%opts); | 
| 127 |  |  |  |  |  |  | } | 
| 128 |  |  |  |  |  |  | *new_i = \&new; | 
| 129 |  |  |  |  |  |  |  | 
| 130 |  |  |  |  |  |  | ##-- ddc-json compat | 
| 131 |  |  |  |  |  |  | __PACKAGE__->defalias('Seed'=>'Arg1', 0,1); | 
| 132 | 0 |  |  | 0 |  | 0 | sub jsonMinMax { return (Seed=>$_[0]{Arg1}); } | 
| 133 |  |  |  |  |  |  |  | 
| 134 |  |  |  |  |  |  | ##====================================================================== | 
| 135 |  |  |  |  |  |  | ## CQFBiblSort | 
| 136 |  |  |  |  |  |  | package DDC::PP::CQFBiblSort; | 
| 137 | 20 |  |  | 20 |  | 161 | use strict; | 
|  | 20 |  |  |  |  | 65 |  | 
|  | 20 |  |  |  |  | 4957 |  | 
| 138 |  |  |  |  |  |  | our @ISA = qw(DDC::PP::CQFSort); | 
| 139 |  |  |  |  |  |  |  | 
| 140 | 0 |  |  | 0 |  | 0 | sub defaultSort { return 'LessByFreeBiblField'; } | 
| 141 |  |  |  |  |  |  | sub new { | 
| 142 | 0 |  |  | 0 |  | 0 | my ($that,$ftype,$field,$lb,$ub,%opts) = @_; | 
| 143 | 0 |  |  |  |  | 0 | return $that->SUPER::new($ftype,$field,$lb,$ub,%opts); | 
| 144 |  |  |  |  |  |  | } | 
| 145 |  |  |  |  |  |  |  | 
| 146 |  |  |  |  |  |  | sub toString { | 
| 147 | 0 |  |  | 0 |  | 0 | my $f = shift; | 
| 148 |  |  |  |  |  |  | return ('#'.uc($DDC::PP::HitSortEnumStrings[$f->{Type}]) | 
| 149 |  |  |  |  |  |  | .'['.join(',', | 
| 150 |  |  |  |  |  |  | $f->argString($f->{Arg0}), | 
| 151 |  |  |  |  |  |  | (defined($f->{Arg1}) || defined($f->{Arg2}) | 
| 152 | 0 | 0 | 0 |  |  | 0 | ? ($f->argString($f->{Arg1}),$f->argString($f->{Arg2})) | 
| 153 |  |  |  |  |  |  | : qw()), | 
| 154 |  |  |  |  |  |  | ) | 
| 155 |  |  |  |  |  |  | .']'); | 
| 156 |  |  |  |  |  |  | } | 
| 157 |  |  |  |  |  |  |  | 
| 158 |  |  |  |  |  |  | ##-- ddc-json compat | 
| 159 |  |  |  |  |  |  | __PACKAGE__->defalias('Field'=>'Arg0', 0,1); | 
| 160 | 0 |  |  | 0 |  | 0 | sub jsonData { return (Field=>$_[0]{Arg0}, $_[0]->SUPER::jsonData); } | 
| 161 |  |  |  |  |  |  |  | 
| 162 |  |  |  |  |  |  |  | 
| 163 |  |  |  |  |  |  | ##====================================================================== | 
| 164 |  |  |  |  |  |  | ## CQFContextSort | 
| 165 |  |  |  |  |  |  | package DDC::PP::CQFContextSort; | 
| 166 | 20 |  |  | 20 |  | 150 | use strict; | 
|  | 20 |  |  |  |  | 45 |  | 
|  | 20 |  |  |  |  | 5970 |  | 
| 167 |  |  |  |  |  |  | our @ISA = qw(DDC::PP::CQFSort); | 
| 168 |  |  |  |  |  |  |  | 
| 169 | 0 |  |  | 0 |  | 0 | sub defaultSort { return 'LessByMiddleContext'; } | 
| 170 |  |  |  |  |  |  | sub new { | 
| 171 | 2 |  |  | 2 |  | 12 | my ($that,$ftype,$field,$matchid,$offset,$lb,$ub,%opts) = @_; | 
| 172 | 2 |  | 50 |  |  | 24 | return $that->SUPER::new($ftype,$field,$lb,$ub, MatchId=>($matchid||0), Offset=>($offset||0), %opts); | 
|  |  |  | 50 |  |  |  |  | 
| 173 |  |  |  |  |  |  | } | 
| 174 |  |  |  |  |  |  |  | 
| 175 |  |  |  |  |  |  | sub toString { | 
| 176 | 2 |  |  | 2 |  | 7 | my $f = shift; | 
| 177 |  |  |  |  |  |  | return ('#'.uc($DDC::PP::HitSortEnumStrings[$f->{Type}]) | 
| 178 |  |  |  |  |  |  | .'['.$f->argString($f->{Arg0}) | 
| 179 |  |  |  |  |  |  | .($f->{MatchId} ? " =$f->{MatchId}" : '') | 
| 180 |  |  |  |  |  |  | .sprintf(" %+d", ($f->{Offset}||0)) | 
| 181 |  |  |  |  |  |  | .(defined($f->{Arg1}) || defined($f->{Arg2}) | 
| 182 | 2 | 50 | 50 |  |  | 21 | ? join(',', '', $f->argString($f->{Arg1}), $f->argString($f->{Arg2})) | 
|  |  | 50 | 33 |  |  |  |  | 
| 183 |  |  |  |  |  |  | : '') | 
| 184 |  |  |  |  |  |  | .']'); | 
| 185 |  |  |  |  |  |  | } | 
| 186 |  |  |  |  |  |  |  | 
| 187 | 0 |  |  | 0 |  | 0 | sub jsonData { return (Field=>$_[0]{Arg0}, MatchId=>$_[0]{MatchId}, Offset=>$_[0]{Offset}, $_[0]->SUPER::jsonData); } | 
| 188 |  |  |  |  |  |  | __PACKAGE__->defalias('Field'=>'Arg0', 0,1); | 
| 189 |  |  |  |  |  |  |  | 
| 190 |  |  |  |  |  |  | ##====================================================================== | 
| 191 |  |  |  |  |  |  | ## CQFHasField | 
| 192 |  |  |  |  |  |  | package DDC::PP::CQFHasField; | 
| 193 | 20 |  |  | 20 |  | 161 | use strict; | 
|  | 20 |  |  |  |  | 50 |  | 
|  | 20 |  |  |  |  | 6711 |  | 
| 194 |  |  |  |  |  |  | our @ISA = qw(DDC::PP::CQFSort); | 
| 195 |  |  |  |  |  |  |  | 
| 196 |  |  |  |  |  |  | __PACKAGE__->defprop('Negated'); | 
| 197 | 8 |  |  | 8 |  | 49 | sub defaultSort { return 'NoSort'; } | 
| 198 |  |  |  |  |  |  | sub new { | 
| 199 | 8 |  |  | 8 |  | 30 | my ($that,$field,$val,$negated,%opts) = @_; | 
| 200 | 8 |  | 100 |  |  | 72 | return $that->SUPER::new(undef,$field,$val,'',Negated=>($negated||0),%opts); | 
| 201 |  |  |  |  |  |  | } | 
| 202 |  |  |  |  |  |  |  | 
| 203 | 0 | 0 |  | 0 |  | 0 | sub Negate { $_[0]{Negated} = $_[0]{Negated} ? 0 : 1; } | 
| 204 |  |  |  |  |  |  |  | 
| 205 |  |  |  |  |  |  | sub toString { | 
| 206 | 8 |  |  | 8 |  | 625 | my $f = shift; | 
| 207 |  |  |  |  |  |  | return (($f->{Negated} ? '!' : '') | 
| 208 | 8 | 100 |  |  |  | 89 | ."#HAS[".$f->argStringE($f->{Arg0}).','.$f->valueString.']' | 
| 209 |  |  |  |  |  |  | ); | 
| 210 |  |  |  |  |  |  | } | 
| 211 | 4 |  |  | 4 |  | 15 | sub valueString { return $_[0]->argStringE($_[0]{Arg1}); } | 
| 212 |  |  |  |  |  |  |  | 
| 213 | 0 | 0 |  | 0 |  | 0 | sub jsonMinMax { return (Field=>$_[0]{Arg0}, Value=>$_[0]->jsonFieldValue, Negated=>($_[0]{Negated} ? 1 : 0)); } | 
| 214 | 0 |  |  | 0 |  | 0 | sub jsonFieldValue { return $_[0]{Arg1}; } | 
| 215 |  |  |  |  |  |  | __PACKAGE__->defalias('Field'=>'Arg0', 0,1); | 
| 216 |  |  |  |  |  |  | __PACKAGE__->defalias('Value'=>'Arg1', 0,1); | 
| 217 |  |  |  |  |  |  |  | 
| 218 |  |  |  |  |  |  | ##====================================================================== | 
| 219 |  |  |  |  |  |  | ## CQFHasFieldValue | 
| 220 |  |  |  |  |  |  | package DDC::PP::CQFHasFieldValue; | 
| 221 | 20 |  |  | 20 |  | 150 | use strict; | 
|  | 20 |  |  |  |  | 40 |  | 
|  | 20 |  |  |  |  | 1100 |  | 
| 222 |  |  |  |  |  |  | our @ISA = qw(DDC::PP::CQFHasField); | 
| 223 |  |  |  |  |  |  |  | 
| 224 |  |  |  |  |  |  | ##====================================================================== | 
| 225 |  |  |  |  |  |  | ## CQFHasFieldRegex | 
| 226 |  |  |  |  |  |  | package DDC::PP::CQFHasFieldRegex; | 
| 227 | 20 |  |  | 20 |  | 191 | use strict; | 
|  | 20 |  |  |  |  | 43 |  | 
|  | 20 |  |  |  |  | 3522 |  | 
| 228 |  |  |  |  |  |  | our @ISA = qw(DDC::PP::CQFHasField); | 
| 229 |  |  |  |  |  |  |  | 
| 230 |  |  |  |  |  |  | __PACKAGE__->defprop('Regex'); | 
| 231 |  |  |  |  |  |  | sub new { | 
| 232 | 2 |  |  | 2 |  | 9 | my ($that,$field,$val,$negated,%opts) = @_; | 
| 233 | 2 |  |  |  |  | 18 | return $that->SUPER::new($field,$val,$negated,Regex=>$val,%opts); | 
| 234 |  |  |  |  |  |  | } | 
| 235 |  |  |  |  |  |  |  | 
| 236 | 2 |  |  | 2 |  | 17 | sub valueString { return "/$_[0]{Regex}/"; } | 
| 237 |  |  |  |  |  |  |  | 
| 238 |  |  |  |  |  |  | ##====================================================================== | 
| 239 |  |  |  |  |  |  | ## CQFHasFieldPrefix | 
| 240 |  |  |  |  |  |  | package DDC::PP::CQFHasFieldPrefix; | 
| 241 | 20 |  |  | 20 |  | 139 | use strict; | 
|  | 20 |  |  |  |  | 92 |  | 
|  | 20 |  |  |  |  | 2820 |  | 
| 242 |  |  |  |  |  |  | our @ISA = qw(DDC::PP::CQFHasFieldRegex); | 
| 243 |  |  |  |  |  |  |  | 
| 244 |  |  |  |  |  |  | sub new { | 
| 245 | 0 |  |  | 0 |  | 0 | my ($that,$field,$val,$negated,%opts) = @_; | 
| 246 | 0 |  |  |  |  | 0 | return $that->SUPER::new($field,$val,$negated,Regex=>"^\\Q${val}\\E",%opts); | 
| 247 |  |  |  |  |  |  | } | 
| 248 |  |  |  |  |  |  |  | 
| 249 | 0 |  |  | 0 |  | 0 | sub valueString { return $_[0]->argStringE($_[0]{Arg1}).'*'; } | 
| 250 |  |  |  |  |  |  |  | 
| 251 |  |  |  |  |  |  | ##====================================================================== | 
| 252 |  |  |  |  |  |  | ## CQFHasFieldSuffix | 
| 253 |  |  |  |  |  |  | package DDC::PP::CQFHasFieldSuffix; | 
| 254 | 20 |  |  | 20 |  | 168 | use strict; | 
|  | 20 |  |  |  |  | 43 |  | 
|  | 20 |  |  |  |  | 3182 |  | 
| 255 |  |  |  |  |  |  | our @ISA = qw(DDC::PP::CQFHasFieldRegex); | 
| 256 |  |  |  |  |  |  |  | 
| 257 |  |  |  |  |  |  | sub new { | 
| 258 | 0 |  |  | 0 |  | 0 | my ($that,$field,$val,$negated,%opts) = @_; | 
| 259 | 0 |  |  |  |  | 0 | return $that->SUPER::new($field,$val,$negated,Regex=>"\\Q${val}\\E\$",%opts); | 
| 260 |  |  |  |  |  |  | } | 
| 261 |  |  |  |  |  |  |  | 
| 262 | 0 |  |  | 0 |  | 0 | sub valueString { return '*'.$_[0]->argStringE($_[0]{Arg1}); } | 
| 263 |  |  |  |  |  |  |  | 
| 264 |  |  |  |  |  |  | ##====================================================================== | 
| 265 |  |  |  |  |  |  | ## CQFHasFieldInfix | 
| 266 |  |  |  |  |  |  | package DDC::PP::CQFHasFieldInfix; | 
| 267 | 20 |  |  | 20 |  | 139 | use strict; | 
|  | 20 |  |  |  |  | 50 |  | 
|  | 20 |  |  |  |  | 3019 |  | 
| 268 |  |  |  |  |  |  | our @ISA = qw(DDC::PP::CQFHasFieldRegex); | 
| 269 |  |  |  |  |  |  |  | 
| 270 |  |  |  |  |  |  | sub new { | 
| 271 | 0 |  |  | 0 |  | 0 | my ($that,$field,$val,$negated,%opts) = @_; | 
| 272 | 0 |  |  |  |  | 0 | return $that->SUPER::new($field,$val,$negated,Regex=>"\\Q${val}\\E",%opts); | 
| 273 |  |  |  |  |  |  | } | 
| 274 |  |  |  |  |  |  |  | 
| 275 | 0 |  |  | 0 |  | 0 | sub valueString { return '*'.$_[0]->argStringE($_[0]{Arg1}).'*'; } | 
| 276 |  |  |  |  |  |  |  | 
| 277 |  |  |  |  |  |  | ##====================================================================== | 
| 278 |  |  |  |  |  |  | ## CQFHasFieldSet | 
| 279 |  |  |  |  |  |  | package DDC::PP::CQFHasFieldSet; | 
| 280 | 20 |  |  | 20 |  | 135 | use strict; | 
|  | 20 |  |  |  |  | 42 |  | 
|  | 20 |  |  |  |  | 5255 |  | 
| 281 |  |  |  |  |  |  | our @ISA = qw(DDC::PP::CQFHasField); | 
| 282 |  |  |  |  |  |  |  | 
| 283 |  |  |  |  |  |  | __PACKAGE__->defprop('Values'); | 
| 284 |  |  |  |  |  |  | sub new { | 
| 285 | 2 |  |  | 2 |  | 9 | my ($that,$field,$vals,$negated,%opts) = @_; | 
| 286 | 2 |  | 50 |  |  | 23 | return $that->SUPER::new($field,"{}",$negated,Values=>($vals||[]),%opts); | 
| 287 |  |  |  |  |  |  | } | 
| 288 |  |  |  |  |  |  |  | 
| 289 |  |  |  |  |  |  | sub SetValueString { | 
| 290 | 2 |  |  | 2 |  | 6 | my ($f,$vals) = @_; | 
| 291 | 2 |  | 50 |  |  | 18 | $vals ||= ($f->{Values}||[]); | 
|  |  |  | 33 |  |  |  |  | 
| 292 | 2 |  |  |  |  | 6 | return join(',', map {$f->argStringE($_)} @$vals); | 
|  | 4 |  |  |  |  | 10 |  | 
| 293 |  |  |  |  |  |  | } | 
| 294 | 2 |  |  | 2 |  | 11 | sub valueString { return '{' . $_[0]->SetValueString . '}'; } | 
| 295 |  |  |  |  |  |  |  | 
| 296 | 0 |  |  | 0 |  |  | sub jsonFieldValue { return $_[0]{Values}; } | 
| 297 |  |  |  |  |  |  |  | 
| 298 |  |  |  |  |  |  |  | 
| 299 |  |  |  |  |  |  |  | 
| 300 |  |  |  |  |  |  | 1; ##-- be happy | 
| 301 |  |  |  |  |  |  |  | 
| 302 |  |  |  |  |  |  | =pod | 
| 303 |  |  |  |  |  |  |  | 
| 304 |  |  |  |  |  |  | =head1 NAME | 
| 305 |  |  |  |  |  |  |  | 
| 306 |  |  |  |  |  |  | DDC::PP::CQFilter - pure-perl implementation of DDC::XS::CQFilter | 
| 307 |  |  |  |  |  |  |  | 
| 308 |  |  |  |  |  |  | =head1 SYNOPSIS | 
| 309 |  |  |  |  |  |  |  | 
| 310 |  |  |  |  |  |  | use DDC::PP::CQFilter; | 
| 311 |  |  |  |  |  |  | #... stuff happens ... | 
| 312 |  |  |  |  |  |  |  | 
| 313 |  |  |  |  |  |  |  | 
| 314 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 315 |  |  |  |  |  |  |  | 
| 316 |  |  |  |  |  |  | The DDC::PP::CQFilter class is a pure-perl fork of the L class, | 
| 317 |  |  |  |  |  |  | which see for details. | 
| 318 |  |  |  |  |  |  |  | 
| 319 |  |  |  |  |  |  | =head1 SEE ALSO | 
| 320 |  |  |  |  |  |  |  | 
| 321 |  |  |  |  |  |  | perl(1), | 
| 322 |  |  |  |  |  |  | DDC::PP(3perl), | 
| 323 |  |  |  |  |  |  | DDC::XS::CQFilter(3perl). | 
| 324 |  |  |  |  |  |  |  | 
| 325 |  |  |  |  |  |  | =head1 AUTHOR | 
| 326 |  |  |  |  |  |  |  | 
| 327 |  |  |  |  |  |  | Bryan Jurish Emoocow@cpan.orgE | 
| 328 |  |  |  |  |  |  |  | 
| 329 |  |  |  |  |  |  | =head1 COPYRIGHT AND LICENSE | 
| 330 |  |  |  |  |  |  |  | 
| 331 |  |  |  |  |  |  | Copyright (C) 2016 by Bryan Jurish | 
| 332 |  |  |  |  |  |  |  | 
| 333 |  |  |  |  |  |  | This library is free software; you can redistribute it and/or modify | 
| 334 |  |  |  |  |  |  | it under the same terms as Perl itself, either Perl version 5.14.2 or, | 
| 335 |  |  |  |  |  |  | at your option, any later version of Perl 5 you may have available. | 
| 336 |  |  |  |  |  |  |  | 
| 337 |  |  |  |  |  |  | =cut | 
| 338 |  |  |  |  |  |  |  |