/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 | 0 |     : activeFileName(activeFileName1), | 
| 36 | 0 |       append(append1), | 
| 37 | 0 |       synchronous(synchronous1), | 
| 38 | 0 |       asynchronous(asynchronous1) | 
| 39 | 0 |   {} | 
| 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 | 0 |   : m_priv(std::make_unique<RolloverDescriptionPrivate>(activeFileName1, append1, synchronous1, asynchronous1)) | 
| 76 | 0 | { | 
| 77 | 0 | } | 
| 78 |  |  | 
| 79 | 0 | RolloverDescription::~RolloverDescription(){} | 
| 80 |  |  | 
| 81 |  | LogString RolloverDescription::getActiveFileName() const | 
| 82 | 0 | { | 
| 83 | 0 |   return m_priv->activeFileName; | 
| 84 | 0 | } | 
| 85 |  |  | 
| 86 |  | bool RolloverDescription::getAppend() const | 
| 87 | 0 | { | 
| 88 | 0 |   return m_priv->append; | 
| 89 | 0 | } | 
| 90 |  |  | 
| 91 |  | ActionPtr RolloverDescription::getSynchronous() const | 
| 92 | 0 | { | 
| 93 | 0 |   return m_priv->synchronous; | 
| 94 | 0 | } | 
| 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 | 0 | { | 
| 104 | 0 |   return m_priv->asynchronous; | 
| 105 | 0 | } |