/src/logging-log4cxx/src/main/cpp/patternconverter.cpp
Line | Count | Source |
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 | | #include <log4cxx/logstring.h> |
19 | | #include <log4cxx/pattern/patternconverter.h> |
20 | | #include <log4cxx/helpers/transcoder.h> |
21 | | #include <log4cxx/private/patternconverter_priv.h> |
22 | | |
23 | | using namespace LOG4CXX_NS; |
24 | | using namespace LOG4CXX_NS::pattern; |
25 | | |
26 | | IMPLEMENT_LOG4CXX_OBJECT(PatternConverter) |
27 | | |
28 | | PatternConverter::PatternConverter( |
29 | | std::unique_ptr<PatternConverterPrivate> priv) : |
30 | 357k | m_priv(std::move(priv)) |
31 | 357k | { |
32 | 357k | } |
33 | | |
34 | | PatternConverter::PatternConverter(const LogString& name, |
35 | | const LogString& style) : |
36 | 52.4k | m_priv(std::make_unique<PatternConverterPrivate>(name, style)) |
37 | 52.4k | { |
38 | | |
39 | 52.4k | } log4cxx::pattern::PatternConverter::PatternConverter(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 36 | 40.3k | m_priv(std::make_unique<PatternConverterPrivate>(name, style)) | 37 | 40.3k | { | 38 | | | 39 | 40.3k | } |
log4cxx::pattern::PatternConverter::PatternConverter(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&) Line | Count | Source | 36 | 12.0k | m_priv(std::make_unique<PatternConverterPrivate>(name, style)) | 37 | 12.0k | { | 38 | | | 39 | 12.0k | } |
|
40 | | |
41 | | PatternConverter::~PatternConverter() |
42 | 410k | { |
43 | 410k | } |
44 | | |
45 | | LogString PatternConverter::getName() const |
46 | 0 | { |
47 | 0 | return m_priv->name; |
48 | 0 | } |
49 | | |
50 | | LogString PatternConverter::getStyleClass(const LOG4CXX_NS::helpers::ObjectPtr& /* e */) const |
51 | 0 | { |
52 | 0 | return m_priv->style; |
53 | 0 | } |
54 | | |
55 | | void PatternConverter::append(LogString& toAppendTo, const std::string& src) |
56 | 95.1k | { |
57 | 95.1k | LOG4CXX_DECODE_CHAR(decoded, src); |
58 | 95.1k | toAppendTo.append(decoded); |
59 | 95.1k | } log4cxx::pattern::PatternConverter::append(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 56 | 42.6k | { | 57 | 42.6k | LOG4CXX_DECODE_CHAR(decoded, src); | 58 | 42.6k | toAppendTo.append(decoded); | 59 | 42.6k | } |
log4cxx::pattern::PatternConverter::append(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 56 | 52.5k | { | 57 | 52.5k | LOG4CXX_DECODE_CHAR(decoded, src); | 58 | 52.5k | toAppendTo.append(decoded); | 59 | 52.5k | } |
|
60 | | |
61 | | const FormattingInfo& PatternConverter::getFormattingInfo() const |
62 | 1.07M | { |
63 | 1.07M | return *m_priv->info; |
64 | 1.07M | } |
65 | | |
66 | | void PatternConverter::setFormattingInfo(const FormattingInfoPtr& newValue) |
67 | 228k | { |
68 | 228k | m_priv->info = newValue; |
69 | 228k | } |