/src/logging-log4cxx/src/main/cpp/filerenameaction.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/filerenameaction.h> | 
| 20 |  | #include <log4cxx/private/action_priv.h> | 
| 21 |  |  | 
| 22 |  | using namespace LOG4CXX_NS; | 
| 23 |  | using namespace LOG4CXX_NS::rolling; | 
| 24 |  | using namespace LOG4CXX_NS::helpers; | 
| 25 |  |  | 
| 26 | 0 | #define priv static_cast<FileRenameActionPrivate*>(m_priv.get()) | 
| 27 |  |  | 
| 28 |  | struct FileRenameAction::FileRenameActionPrivate : public ActionPrivate | 
| 29 |  | { | 
| 30 |  |   FileRenameActionPrivate( const File& toRename, | 
| 31 |  |     const File& renameTo, | 
| 32 |  |     bool renameEmptyFile1): | 
| 33 | 0 |     source(toRename), destination(renameTo), renameEmptyFile(renameEmptyFile1) {} | 
| 34 |  |  | 
| 35 |  |   const File source; | 
| 36 |  |   const File destination; | 
| 37 |  |   bool renameEmptyFile; | 
| 38 |  | }; | 
| 39 |  |  | 
| 40 |  | IMPLEMENT_LOG4CXX_OBJECT(FileRenameAction) | 
| 41 |  |  | 
| 42 |  | FileRenameAction::FileRenameAction(const File& toRename, | 
| 43 |  |   const File& renameTo, | 
| 44 |  |   bool renameEmptyFile1) | 
| 45 | 0 |   : Action( std::make_unique<FileRenameActionPrivate>(toRename, renameTo, renameEmptyFile1) ) | 
| 46 | 0 | { | 
| 47 | 0 | } Unexecuted instantiation: log4cxx::rolling::FileRenameAction::FileRenameAction(log4cxx::File const&, log4cxx::File const&, bool)Unexecuted instantiation: log4cxx::rolling::FileRenameAction::FileRenameAction(log4cxx::File const&, log4cxx::File const&, bool) | 
| 48 |  |  | 
| 49 |  | bool FileRenameAction::execute(LOG4CXX_NS::helpers::Pool& pool1) const | 
| 50 | 0 | { | 
| 51 | 0 |   return priv->source.renameTo(priv->destination, pool1); | 
| 52 | 0 | } |