Coverage Report

Created: 2025-10-13 07:02

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/logging-log4cxx/src/main/cpp/rolloverdescription.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/rolling/rolloverdescription.h>
20
21
using namespace LOG4CXX_NS;
22
using namespace LOG4CXX_NS::rolling;
23
using namespace LOG4CXX_NS::helpers;
24
25
IMPLEMENT_LOG4CXX_OBJECT(RolloverDescription)
26
27
struct RolloverDescription::RolloverDescriptionPrivate{
28
0
  RolloverDescriptionPrivate(){}
29
30
  RolloverDescriptionPrivate(
31
    const LogString& activeFileName1,
32
    const bool append1,
33
    const ActionPtr& synchronous1,
34
    const ActionPtr& asynchronous1)
35
3.02k
    : activeFileName(activeFileName1),
36
3.02k
      append(append1),
37
3.02k
      synchronous(synchronous1),
38
3.02k
      asynchronous(asynchronous1)
39
3.02k
  {}
log4cxx::rolling::RolloverDescription::RolloverDescriptionPrivate::RolloverDescriptionPrivate(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, std::__1::shared_ptr<log4cxx::rolling::Action> const&, std::__1::shared_ptr<log4cxx::rolling::Action> const&)
Line
Count
Source
35
772
    : activeFileName(activeFileName1),
36
772
      append(append1),
37
772
      synchronous(synchronous1),
38
772
      asynchronous(asynchronous1)
39
772
  {}
log4cxx::rolling::RolloverDescription::RolloverDescriptionPrivate::RolloverDescriptionPrivate(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, bool, std::__1::shared_ptr<log4cxx::rolling::Action> const&, std::__1::shared_ptr<log4cxx::rolling::Action> const&)
Line
Count
Source
35
2.25k
    : activeFileName(activeFileName1),
36
2.25k
      append(append1),
37
2.25k
      synchronous(synchronous1),
38
2.25k
      asynchronous(asynchronous1)
39
2.25k
  {}
40
41
  /**
42
   * Active log file name after rollover.
43
   */
44
  LogString activeFileName;
45
46
  /**
47
   * Should active file be opened for appending.
48
   */
49
  bool append;
50
51
  /**
52
   * Action to be completed after close of current active log file
53
   * before returning control to caller.
54
   */
55
  ActionPtr synchronous;
56
57
  /**
58
   * Action to be completed after close of current active log file
59
   * and before next rollover attempt, may be executed asynchronously.
60
   */
61
  ActionPtr asynchronous;
62
};
63
64
65
RolloverDescription::RolloverDescription() :
66
0
  m_priv(std::make_unique<RolloverDescriptionPrivate>())
67
0
{
68
0
}
69
70
RolloverDescription::RolloverDescription(
71
  const LogString& activeFileName1,
72
  const bool append1,
73
  const ActionPtr& synchronous1,
74
  const ActionPtr& asynchronous1)
75
3.02k
  : m_priv(std::make_unique<RolloverDescriptionPrivate>(activeFileName1, append1, synchronous1, asynchronous1))
76
3.02k
{
77
3.02k
}
log4cxx::rolling::RolloverDescription::RolloverDescription(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, std::__1::shared_ptr<log4cxx::rolling::Action> const&, std::__1::shared_ptr<log4cxx::rolling::Action> const&)
Line
Count
Source
75
772
  : m_priv(std::make_unique<RolloverDescriptionPrivate>(activeFileName1, append1, synchronous1, asynchronous1))
76
772
{
77
772
}
log4cxx::rolling::RolloverDescription::RolloverDescription(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, bool, std::__1::shared_ptr<log4cxx::rolling::Action> const&, std::__1::shared_ptr<log4cxx::rolling::Action> const&)
Line
Count
Source
75
2.25k
  : m_priv(std::make_unique<RolloverDescriptionPrivate>(activeFileName1, append1, synchronous1, asynchronous1))
76
2.25k
{
77
2.25k
}
78
79
3.02k
RolloverDescription::~RolloverDescription(){}
80
81
LogString RolloverDescription::getActiveFileName() const
82
3.04k
{
83
3.04k
  return m_priv->activeFileName;
84
3.04k
}
85
86
bool RolloverDescription::getAppend() const
87
3.02k
{
88
3.02k
  return m_priv->append;
89
3.02k
}
90
91
ActionPtr RolloverDescription::getSynchronous() const
92
3.04k
{
93
3.04k
  return m_priv->synchronous;
94
3.04k
}
95
96
/**
97
 * Action to be completed after close of current active log file
98
 * and before next rollover attempt, may be executed asynchronously.
99
 *
100
 * @return action, may be null.
101
 */
102
ActionPtr RolloverDescription::getAsynchronous() const
103
3.02k
{
104
3.02k
  return m_priv->asynchronous;
105
3.02k
}