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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Xapian: API Documentation: xapian-core: Xapian::DateValueRangeProcessor Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.5.9 -->
<script type="text/javascript">
<!--
function changeDisplayState (e){
var num=this.id.replace(/[^[0-9]/g,'');
var button=this.firstChild;
var sectionDiv=document.getElementById('dynsection'+num);
if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
sectionDiv.style.display='block';
button.src='open.gif';
}else{
sectionDiv.style.display='none';
button.src='closed.gif';
}
}
function initDynSections(){
var divs=document.getElementsByTagName('div');
var sectionCounter=1;
for(var i=0;i<divs.length-1;i++){
if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
var header=divs[i];
var section=divs[i+1];
var button=header.firstChild;
if (button!='IMG'){
divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
button=document.createElement('img');
divs[i].insertBefore(button,divs[i].firstChild);
}
header.style.cursor='pointer';
header.onclick=changeDisplayState;
header.id='dynheader'+sectionCounter;
button.src='closed.gif';
section.id='dynsection'+sectionCounter;
section.style.display='none';
section.style.marginLeft='14px';
sectionCounter++;
}
}
}
window.onload = initDynSections;
-->
</script>
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div class="navpath"><a class="el" href="namespaceXapian.html">Xapian</a>::<a class="el" href="classXapian_1_1DateValueRangeProcessor.html">DateValueRangeProcessor</a>
</div>
</div>
<div class="contents">
<h1>Xapian::DateValueRangeProcessor Class Reference</h1><!-- doxytag: class="Xapian::DateValueRangeProcessor" --><!-- doxytag: inherits="Xapian::StringValueRangeProcessor" -->Handle a date range.
<a href="#_details">More...</a>
<p>
<div class="dynheader">
Inheritance diagram for Xapian::DateValueRangeProcessor:</div>
<div class="dynsection">
<p><center><img src="classXapian_1_1DateValueRangeProcessor__inherit__graph.png" border="0" usemap="#Xapian_1_1DateValueRangeProcessor__inherit__map" alt="Inheritance graph"></center>
<map name="Xapian_1_1DateValueRangeProcessor__inherit__map">
<area shape="rect" href="classXapian_1_1StringValueRangeProcessor.html" title="Handle a string range." alt="" coords="5,84,253,111"><area shape="rect" href="structXapian_1_1ValueRangeProcessor.html" title="Base class for value range processors." alt="" coords="24,7,235,33"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
<p>
<a href="classXapian_1_1DateValueRangeProcessor-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1DateValueRangeProcessor.html#dfec2564921b21c35bd72c63d1793745">DateValueRangeProcessor</a> (<a class="el" href="namespaceXapian.html#94a899651fa920c72ffa9635bde630ea">Xapian::valueno</a> slot_, bool prefer_mdy_=false, int epoch_year_=1970)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#dfec2564921b21c35bd72c63d1793745"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1DateValueRangeProcessor.html#ca14923c4886029ac19f96ea145ede38">DateValueRangeProcessor</a> (<a class="el" href="namespaceXapian.html#94a899651fa920c72ffa9635bde630ea">Xapian::valueno</a> slot_, const std::string &str_, bool prefix_=true, bool prefer_mdy_=false, int epoch_year_=1970)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#ca14923c4886029ac19f96ea145ede38"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespaceXapian.html#94a899651fa920c72ffa9635bde630ea">Xapian::valueno</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1DateValueRangeProcessor.html#29c079d9156a872f38fca82195525a92">operator()</a> (std::string &begin, std::string &end)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Check for a valid date range. <a href="#29c079d9156a872f38fca82195525a92"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Handle a date range.
<p>
Begin and end must be dates in a recognised format. <hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="dfec2564921b21c35bd72c63d1793745"></a><!-- doxytag: member="Xapian::DateValueRangeProcessor::DateValueRangeProcessor" ref="dfec2564921b21c35bd72c63d1793745" args="(Xapian::valueno slot_, bool prefer_mdy_=false, int epoch_year_=1970)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Xapian::DateValueRangeProcessor::DateValueRangeProcessor </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespaceXapian.html#94a899651fa920c72ffa9635bde630ea">Xapian::valueno</a> </td>
<td class="paramname"> <em>slot_</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"> <em>prefer_mdy_</em> = <code>false</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>epoch_year_</em> = <code>1970</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Constructor.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>slot_</em> </td><td>The value number to return from operator(). </td></tr>
<tr><td valign="top"></td><td valign="top"><em>prefer_mdy_</em> </td><td>Should ambiguous dates be interpreted as month/day/year rather than day/month/year? (default: false) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>epoch_year_</em> </td><td>Year to use as the epoch for dates with 2 digit years (default: 1970, so 1/1/69 is 2069 while 1/1/70 is 1970). </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="ca14923c4886029ac19f96ea145ede38"></a><!-- doxytag: member="Xapian::DateValueRangeProcessor::DateValueRangeProcessor" ref="ca14923c4886029ac19f96ea145ede38" args="(Xapian::valueno slot_, const std::string &str_, bool prefix_=true, bool prefer_mdy_=false, int epoch_year_=1970)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Xapian::DateValueRangeProcessor::DateValueRangeProcessor </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespaceXapian.html#94a899651fa920c72ffa9635bde630ea">Xapian::valueno</a> </td>
<td class="paramname"> <em>slot_</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string & </td>
<td class="paramname"> <em>str_</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"> <em>prefix_</em> = <code>true</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"> <em>prefer_mdy_</em> = <code>false</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>epoch_year_</em> = <code>1970</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Constructor.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>slot_</em> </td><td>The value number to return from operator().</td></tr>
<tr><td valign="top"></td><td valign="top"><em>str_</em> </td><td>A string to look for to recognise values as belonging to this date range.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>prefix_</em> </td><td>Whether to look for the string at the start or end of the values. If true, the string is a prefix; if false, the string is a suffix (default: true).</td></tr>
<tr><td valign="top"></td><td valign="top"><em>prefer_mdy_</em> </td><td>Should ambiguous dates be interpreted as month/day/year rather than day/month/year? (default: false)</td></tr>
<tr><td valign="top"></td><td valign="top"><em>epoch_year_</em> </td><td>Year to use as the epoch for dates with 2 digit years (default: 1970, so 1/1/69 is 2069 while 1/1/70 is 1970).</td></tr>
</table>
</dl>
The string supplied in str_ is used by <em>operator()</em> to decide whether the pair of strings supplied to it constitute a valid range. If prefix_ is true, the first value in a range must begin with str_ (and the second value may optionally begin with str_); if prefix_ is false, the second value in a range must end with str_ (and the first value may optionally end with str_).<p>
If str_ is empty, the setting of prefix_ is irrelevant, and no special strings are required at the start or end of the strings defining the range.<p>
The remainder of both strings defining the endpoints must be valid dates.<p>
For example, if str_ is "created:" and prefix_ is true, and the range processor has been added to the queryparser, the queryparser will accept "created:1/1/2000..31/12/2001".
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="29c079d9156a872f38fca82195525a92"></a><!-- doxytag: member="Xapian::DateValueRangeProcessor::operator()" ref="29c079d9156a872f38fca82195525a92" args="(std::string &begin, std::string &end)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespaceXapian.html#94a899651fa920c72ffa9635bde630ea">Xapian::valueno</a> Xapian::DateValueRangeProcessor::operator() </td>
<td>(</td>
<td class="paramtype">std::string & </td>
<td class="paramname"> <em>begin</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::string & </td>
<td class="paramname"> <em>end</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Check for a valid date range.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in,out]</tt> </td><td valign="top"><em>begin</em> </td><td>The start of the range as specified in the query string by the user. This parameter is a non-const reference so the <a class="el" href="structXapian_1_1ValueRangeProcessor.html" title="Base class for value range processors.">ValueRangeProcessor</a> can modify it to return the value to start the range with. </td></tr>
<tr><td valign="top"><tt>[in,out]</tt> </td><td valign="top"><em>end</em> </td><td>The end of the range. This is also a non-const reference so it can be modified.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>If BEGIN..END is a sensible date range, this method modifies them into the format YYYYMMDD and returns the value of slot_ passed at construction time. Otherwise it returns <a class="el" href="namespaceXapian.html#0a75ef120e641c77f703e60f595ffda2" title="Reserved value to indicate "no valueno".">Xapian::BAD_VALUENO</a>. </dd></dl>
<p>Reimplemented from <a class="el" href="classXapian_1_1StringValueRangeProcessor.html#ac2cd6bf4645a3bb242cf5ad5022ae5e">Xapian::StringValueRangeProcessor</a>.</p>
</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>xapian/<a class="el" href="queryparser_8h.html">queryparser.h</a></ul>
</div>
<hr>
<address><small>
Documentation for Xapian (version 1.2.12).<br>
Generated on 27 Jun 2012 by
<a href="http://www.doxygen.org/">Doxygen 1.5.9</a>.
</small></address>
</body>
</html>
|