Apache Log4cxx  Version 1.7.0
Loading...
Searching...
No Matches
patternconverter.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_PATTERN_PATTERN_CONVERTER_H
19#define _LOG4CXX_PATTERN_PATTERN_CONVERTER_H
20
21
23#include <log4cxx/logstring.h>
25#include <vector>
26
27#define DECLARE_LOG4CXX_PATTERN(cls) DECLARE_ABSTRACT_LOG4CXX_OBJECT(cls)
28
29namespace LOG4CXX_NS
30{
31namespace pattern
32{
33
34typedef std::vector<LogString> OptionsList;
35
46class LOG4CXX_EXPORT PatternConverter : public virtual helpers::Object
47{
48 protected:
49 LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(PatternConverterPrivate, m_priv)
50 PatternConverter(LOG4CXX_PRIVATE_PTR(PatternConverterPrivate) priv);
51
59 const LogString& style);
60
61 virtual ~PatternConverter();
62
63 public:
68
75 virtual void format(const helpers::ObjectPtr& obj,
76 LogString& toAppendTo,
77 helpers::Pool& p) const = 0;
78
87
97 virtual LogString getStyleClass(const helpers::ObjectPtr& e) const;
98
103
108
109 protected:
115 static void append(LogString& toAppendTo, const std::string& src);
116};
117
118
120
121}
122}
123
124
125#endif
base class for java-like objects.
Definition object.h:102
Modifies the output of a pattern converter for a specified minimum and maximum width and alignment.
Definition formattinginfo.h:44
Definition patternconverter.h:47
PatternConverter(LOG4CXX_PRIVATE_PTR(PatternConverterPrivate) priv)
LogString getName() const
This method returns the name of the conversion pattern.
static void append(LogString &toAppendTo, const std::string &src)
Appends content in the locale code page to a LogString.
const FormattingInfo & getFormattingInfo() const
Provides a minimum width, a maximum width and the alignment.
void setFormattingInfo(const FormattingInfoPtr &newValue)
Use newValue for the minimum width, a maximum width and the alignment.
virtual LogString getStyleClass(const helpers::ObjectPtr &e) const
This method returns the CSS style class that should be applied to the LoggingEvent passed as paramete...
virtual void format(const helpers::ObjectPtr &obj, LogString &toAppendTo, helpers::Pool &p) const =0
Formats an object into a string buffer.
Definition propertysetter.h:27
std::vector< LogString > OptionsList
Definition patternconverter.h:34
std::shared_ptr< FormattingInfo > FormattingInfoPtr
Definition formattinginfo.h:32
LOG4CXX_PTR_DEF(DatePatternConverter)
std::basic_string< logchar > LogString
Definition logstring.h:60
#define LOG4CXX_CAST_ENTRY(Interface)
Definition object.h:154
#define END_LOG4CXX_CAST_MAP()
Definition object.h:148
#define BEGIN_LOG4CXX_CAST_MAP()
Definition object.h:142
#define DECLARE_LOG4CXX_PATTERN(cls)
Definition patternconverter.h:27