blob: c229d4efd420656d16e60225d44ae27617b72eaa [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Apache log4cxx: CachedDateFormat Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.6 -->
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li id="current"><a href="classes.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="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul></div>
<div class="nav">
<a class="el" href="namespacelog4cxx.html">log4cxx</a>::<a class="el" href="namespacelog4cxx_1_1pattern.html">pattern</a>::<a class="el" href="classlog4cxx_1_1pattern_1_1_cached_date_format.html">CachedDateFormat</a></div>
<h1>CachedDateFormat Class Reference</h1><!-- doxytag: class="log4cxx::pattern::CachedDateFormat" --><!-- doxytag: inherits="log4cxx::helpers::DateFormat" -->Inherits <a class="el" href="classlog4cxx_1_1helpers_1_1_date_format.html">DateFormat</a>.
<p>
<a href="classlog4cxx_1_1pattern_1_1_cached_date_format-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 Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum &nbsp;</td><td class="memItemRight" valign="bottom">{ <a class="el" href="classlog4cxx_1_1pattern_1_1_cached_date_format.html#06fc87d81c62e9abb8790b6e5713c55b7be08bab91f2340e7221e8ffe2ddac49">NO_MILLISECONDS</a> = -2,
<a class="el" href="classlog4cxx_1_1pattern_1_1_cached_date_format.html#06fc87d81c62e9abb8790b6e5713c55b1b695a298b4ea96545e125c36a1ded3c">UNRECOGNIZED_MILLISECONDS</a> = -1
}</td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1pattern_1_1_cached_date_format.html#e5f327d96f89fe1ae7ca4f182bb8d36f">CachedDateFormat</a> (const log4cxx::helpers::DateFormatPtr &amp;dateFormat, int expiration)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a new <a class="el" href="classlog4cxx_1_1pattern_1_1_cached_date_format.html">CachedDateFormat</a> object. <a href="#e5f327d96f89fe1ae7ca4f182bb8d36f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1pattern_1_1_cached_date_format.html#a7657d218e7a6847b2160d87ae4389c0">format</a> (<a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;sbuf, log4cxx_time_t date, <a class="el" href="classlog4cxx_1_1helpers_1_1_pool.html">log4cxx::helpers::Pool</a> &amp;p) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Formats a Date into a date/time string. <a href="#a7657d218e7a6847b2160d87ae4389c0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1pattern_1_1_cached_date_format.html#9f84241757bbfca5c06353ab6ffaf95d">setTimeZone</a> (const log4cxx::helpers::TimeZonePtr &amp;zone)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set timezone. <a href="#9f84241757bbfca5c06353ab6ffaf95d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1pattern_1_1_cached_date_format.html#d5f69e832f2e604c0bf64b1fecb9ce82">numberFormat</a> (<a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;s, int n, <a class="el" href="classlog4cxx_1_1helpers_1_1_pool.html">log4cxx::helpers::Pool</a> &amp;p) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Format an integer consistent with the format method. <a href="#d5f69e832f2e604c0bf64b1fecb9ce82"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1pattern_1_1_cached_date_format.html#f9d0f8f14823faa4bbe7f344fa89af75">findMillisecondStart</a> (log4cxx_time_t time, const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;formatted, const log4cxx::helpers::DateFormatPtr &amp;formatter, <a class="el" href="classlog4cxx_1_1helpers_1_1_pool.html">log4cxx::helpers::Pool</a> &amp;pool)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Finds start of millisecond field in formatted time. <a href="#f9d0f8f14823faa4bbe7f344fa89af75"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1pattern_1_1_cached_date_format.html#6f5274fcb26c6fc5ccf2cae9191e1ec1">getMaximumCacheValidity</a> (const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;pattern)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Gets maximum cache validity for the specified SimpleDateTime conversion pattern. <a href="#6f5274fcb26c6fc5ccf2cae9191e1ec1"></a><br></td></tr>
</table>
<hr><h2>Member Enumeration Documentation</h2>
<a class="anchor" name="06fc87d81c62e9abb8790b6e5713c55b"></a><!-- doxytag: member="log4cxx::pattern::CachedDateFormat::@0" ref="06fc87d81c62e9abb8790b6e5713c55b" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">anonymous enum </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
<dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" name="06fc87d81c62e9abb8790b6e5713c55b7be08bab91f2340e7221e8ffe2ddac49"></a><!-- doxytag: member="NO_MILLISECONDS" ref="06fc87d81c62e9abb8790b6e5713c55b7be08bab91f2340e7221e8ffe2ddac49" args="" -->NO_MILLISECONDS</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="06fc87d81c62e9abb8790b6e5713c55b1b695a298b4ea96545e125c36a1ded3c"></a><!-- doxytag: member="UNRECOGNIZED_MILLISECONDS" ref="06fc87d81c62e9abb8790b6e5713c55b1b695a298b4ea96545e125c36a1ded3c" args="" -->UNRECOGNIZED_MILLISECONDS</em>&nbsp;</td><td>
</td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="e5f327d96f89fe1ae7ca4f182bb8d36f"></a><!-- doxytag: member="log4cxx::pattern::CachedDateFormat::CachedDateFormat" ref="e5f327d96f89fe1ae7ca4f182bb8d36f" args="(const log4cxx::helpers::DateFormatPtr &amp;dateFormat, int expiration)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="classlog4cxx_1_1pattern_1_1_cached_date_format.html">CachedDateFormat</a> </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const log4cxx::helpers::DateFormatPtr &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>dateFormat</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>expiration</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Creates a new <a class="el" href="classlog4cxx_1_1pattern_1_1_cached_date_format.html">CachedDateFormat</a> object.
<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>dateFormat</em>&nbsp;</td><td>Date format, may not be null. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>expiration</em>&nbsp;</td><td>maximum cached range in microseconds. If the dateFormat is known to be incompatible with the caching algorithm, use a value of 0 to totally disable caching or 1 to only use cache for duplicate requests. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="f9d0f8f14823faa4bbe7f344fa89af75"></a><!-- doxytag: member="log4cxx::pattern::CachedDateFormat::findMillisecondStart" ref="f9d0f8f14823faa4bbe7f344fa89af75" args="(log4cxx_time_t time, const LogString &amp;formatted, const log4cxx::helpers::DateFormatPtr &amp;formatter, log4cxx::helpers::Pool &amp;pool)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static int findMillisecondStart </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">log4cxx_time_t&nbsp;</td>
<td class="mdname" nowrap> <em>time</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>formatted</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const log4cxx::helpers::DateFormatPtr &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>formatter</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="classlog4cxx_1_1helpers_1_1_pool.html">log4cxx::helpers::Pool</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>pool</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Finds start of millisecond field in formatted time.
<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>time</em>&nbsp;</td><td>long time, must be integral number of seconds </td></tr>
<tr><td valign="top"></td><td valign="top"><em>formatted</em>&nbsp;</td><td>String corresponding formatted string </td></tr>
<tr><td valign="top"></td><td valign="top"><em>formatter</em>&nbsp;</td><td>DateFormat date format </td></tr>
<tr><td valign="top"></td><td valign="top"><em>pool</em>&nbsp;</td><td>pool. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>int position in string of first digit of milliseconds, -1 indicates no millisecond field, -2 indicates unrecognized field (likely RelativeTimeDateFormat) </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="a7657d218e7a6847b2160d87ae4389c0"></a><!-- doxytag: member="log4cxx::pattern::CachedDateFormat::format" ref="a7657d218e7a6847b2160d87ae4389c0" args="(LogString &amp;sbuf, log4cxx_time_t date, log4cxx::helpers::Pool &amp;p) const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual void format </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>sbuf</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>log4cxx_time_t&nbsp;</td>
<td class="mdname" nowrap> <em>date</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="classlog4cxx_1_1helpers_1_1_pool.html">log4cxx::helpers::Pool</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>p</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"> const<code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Formats a Date into a date/time string.
<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>date</em>&nbsp;</td><td>the date to format. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>sbuf</em>&nbsp;</td><td>the string buffer to write to. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>p</em>&nbsp;</td><td>memory pool. </td></tr>
</table>
</dl>
<p>
Implements <a class="el" href="classlog4cxx_1_1helpers_1_1_date_format.html#96fc17cefabd50dec2d68967e45d36f1">DateFormat</a>. </td>
</tr>
</table>
<a class="anchor" name="6f5274fcb26c6fc5ccf2cae9191e1ec1"></a><!-- doxytag: member="log4cxx::pattern::CachedDateFormat::getMaximumCacheValidity" ref="6f5274fcb26c6fc5ccf2cae9191e1ec1" args="(const LogString &amp;pattern)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static int getMaximumCacheValidity </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>pattern</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Gets maximum cache validity for the specified SimpleDateTime conversion pattern.
<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>pattern</em>&nbsp;</td><td>conversion pattern, may not be null. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>Duration in microseconds from an integral second that the cache will return consistent results. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="d5f69e832f2e604c0bf64b1fecb9ce82"></a><!-- doxytag: member="log4cxx::pattern::CachedDateFormat::numberFormat" ref="d5f69e832f2e604c0bf64b1fecb9ce82" args="(LogString &amp;s, int n, log4cxx::helpers::Pool &amp;p) const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual void numberFormat </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>s</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>n</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="classlog4cxx_1_1helpers_1_1_pool.html">log4cxx::helpers::Pool</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>p</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"> const<code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Format an integer consistent with the format method.
<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>s</em>&nbsp;</td><td>string to which the numeric string is appended. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>n</em>&nbsp;</td><td>integer value. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>p</em>&nbsp;</td><td>memory pool used during formatting. </td></tr>
</table>
</dl>
<p>
Reimplemented from <a class="el" href="classlog4cxx_1_1helpers_1_1_date_format.html#d5f69e832f2e604c0bf64b1fecb9ce82">DateFormat</a>. </td>
</tr>
</table>
<a class="anchor" name="9f84241757bbfca5c06353ab6ffaf95d"></a><!-- doxytag: member="log4cxx::pattern::CachedDateFormat::setTimeZone" ref="9f84241757bbfca5c06353ab6ffaf95d" args="(const log4cxx::helpers::TimeZonePtr &amp;zone)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual void setTimeZone </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const log4cxx::helpers::TimeZonePtr &amp;&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>zone</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set timezone.
<p>
<dl compact><dt><b>Remarks:</b></dt><dd>Setting the timezone using getCalendar().<a class="el" href="classlog4cxx_1_1pattern_1_1_cached_date_format.html#9f84241757bbfca5c06353ab6ffaf95d">setTimeZone()</a> will likely cause caching to misbehave. </dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>zone</em>&nbsp;</td><td>TimeZone new timezone </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="cacheddateformat_8h.html">cacheddateformat.h</a></ul>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
</BODY>
</HTML>