Apache Log4cxx
Version 1.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
cacheddateformat.h
Go to the documentation of this file.
1
/*
2
* Licensed to the Apache Software Foundation (ASF) under one or more
3
* contributor license agreements. See the NOTICE file distributed with
4
* this work for additional information regarding copyright ownership.
5
* The ASF licenses this file to You under the Apache License, Version 2.0
6
* (the "License"); you may not use this file except in compliance with
7
* the License. You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*/
17
18
#ifndef _LOG4CXX_HELPERS_CACHED_DATE_FORMAT_H
19
#define _LOG4CXX_HELPERS_CACHED_DATE_FORMAT_H
20
21
#include <
log4cxx/helpers/dateformat.h
>
22
23
namespace
LOG4CXX_NS
24
{
25
namespace
pattern
26
{
27
class
LOG4CXX_EXPORT
CachedDateFormat
:
public
LOG4CXX_NS::helpers::DateFormat
28
{
29
public
:
30
enum
31
{
32
/*
33
* Constant used to represent that there was no change
34
* observed when changing the millisecond count.
35
*/
36
NO_MILLISECONDS
= -2,
37
/*
38
* Constant used to represent that there was an
39
* observed change, but was an expected change.
40
*/
41
UNRECOGNIZED_MILLISECONDS
= -1
42
};
43
44
private
:
51
static
const
logchar digits[];
52
53
58
static
const
int
magic1;
59
60
64
static
const
logchar magicString1[];
65
66
71
static
const
int
magic2;
72
73
77
static
const
logchar magicString2[];
78
79
83
static
const
logchar zeroString[];
84
85
LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(CachedDateFormatPriv, m_priv)
86
87
public
:
96
CachedDateFormat
(
const
LOG4CXX_NS::helpers::DateFormatPtr& dateFormat,
int
expiration);
97
~CachedDateFormat
();
98
109
static
int
findMillisecondStart
(
110
log4cxx_time_t time,
const
LogString
& formatted,
111
const
LOG4CXX_NS::helpers::DateFormatPtr& formatter,
112
LOG4CXX_NS::helpers::Pool& pool);
113
121
virtual
void
format
(
LogString
& sbuf,
122
log4cxx_time_t date,
123
LOG4CXX_NS::helpers::Pool& p)
const
;
124
125
private
:
133
static
void
millisecondFormat(
int
millis,
134
LogString
& buf,
135
int
offset);
136
137
138
public
:
146
virtual
void
setTimeZone
(
const
LOG4CXX_NS::helpers::TimeZonePtr& zone);
147
154
virtual
void
numberFormat
(
LogString
& s,
155
int
n,
156
LOG4CXX_NS::helpers::Pool& p)
const
;
157
165
static
int
getMaximumCacheValidity
(
const
LogString
&
pattern
);
166
167
private
:
168
CachedDateFormat
(
const
CachedDateFormat
&);
169
CachedDateFormat
& operator=(
const
CachedDateFormat
&);
170
180
static
bool
regionMatches(
181
const
LogString
& target,
182
size_t
toffset,
183
const
LogString
& other,
184
size_t
ooffset,
185
size_t
len);
186
187
};
188
189
190
191
}
// namespace helpers
192
}
// namespace log4cxx
193
194
#endif
// _LOG4CXX_HELPERS_SIMPLE_DATE_FORMAT_H
log4cxx::pattern::CachedDateFormat::CachedDateFormat
CachedDateFormat(const log4cxx::helpers::DateFormatPtr &dateFormat, int expiration)
Creates a new CachedDateFormat object.
log4cxx::pattern::CachedDateFormat::findMillisecondStart
static int findMillisecondStart(log4cxx_time_t time, const LogString &formatted, const log4cxx::helpers::DateFormatPtr &formatter, log4cxx::helpers::Pool &pool)
Finds start of millisecond field in formatted time.
log4cxx::pattern::CachedDateFormat::numberFormat
virtual void numberFormat(LogString &s, int n, log4cxx::helpers::Pool &p) const
Format an integer consistent with the format method.
log4cxx::pattern::CachedDateFormat::format
virtual void format(LogString &sbuf, log4cxx_time_t date, log4cxx::helpers::Pool &p) const
Formats a Date into a date/time string.
log4cxx::pattern::CachedDateFormat::~CachedDateFormat
~CachedDateFormat()
log4cxx::pattern::CachedDateFormat::getMaximumCacheValidity
static int getMaximumCacheValidity(const LogString &pattern)
Gets maximum cache validity for the specified SimpleDateTime conversion pattern.
log4cxx::pattern::CachedDateFormat::NO_MILLISECONDS
@ NO_MILLISECONDS
Definition
cacheddateformat.h:36
log4cxx::pattern::CachedDateFormat::UNRECOGNIZED_MILLISECONDS
@ UNRECOGNIZED_MILLISECONDS
Definition
cacheddateformat.h:41
log4cxx::pattern::CachedDateFormat::setTimeZone
virtual void setTimeZone(const log4cxx::helpers::TimeZonePtr &zone)
Set timezone.
dateformat.h
log4cxx::pattern
Definition
cacheddateformat.h:26
log4cxx::LogString
std::basic_string< logchar > LogString
Definition
logstring.h:60
src
main
include
log4cxx
helpers
cacheddateformat.h
Generated by
1.17.0 on
SITE_PUBLISHED_DATE
Copyright © 2017-2026
Apache Software Foundation
. Apache, Chainsaw, log4cxx, Log4j, Log4net, log4php and the Apache logo are
trademarks or registered trademarks
of The Apache Software Foundation.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Privacy Policy
.