2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 ///////////////////////////////////////////////////////////////////////////////
18 /// \ingroup tag_SS_LoggerService
19 /// \brief This file supports error event logging.
21 ///////////////////////////////////////////////////////////////////////////////
22 #ifndef LOGGER_SERVICE_SERVER_INCLUDE_SS_LOGGER_ERROR_EVENT_ARCHIVE_H_
23 #define LOGGER_SERVICE_SERVER_INCLUDE_SS_LOGGER_ERROR_EVENT_ARCHIVE_H_
25 #include <native_service/frameworkunified_types.h>
26 #include <native_service/frameworkunified_framework_if.h>
28 #include <libtar_listhash.h>
31 #include <system_service/ss_system_types.h>
35 class CErrorEventArchive {
38 ~CErrorEventArchive();
40 EFrameworkunifiedStatus openArchive(std::string f_pathAndName);
42 EFrameworkunifiedStatus addToArchive(std::vector<std::string> f_filePathAndNameList);
44 EFrameworkunifiedStatus addToArchive(std::string f_filePathAndName,
45 std::string f_destinationName, UI_8 f_depth =
46 CErrorEventArchive::MAX_DIRECTORY_DEPTH);
48 EFrameworkunifiedStatus closeArchive(void);
50 static SI_32 gzOpenArchive(PCHAR f_pcPathname, SI_32 f_siOflags,
53 static SI_32 gzCloseArchive();
55 static ssize_t gzWriteArchive(int fd, const void* buf, size_t count);
57 static ssize_t gzReadArchive(int fd, void* buf, size_t count);
59 static const UI_8 MAX_DIRECTORY_DEPTH = 4;
62 EFrameworkunifiedStatus addFileToArchive(std::string f_filename,
63 std::string f_destinationName);
65 EFrameworkunifiedStatus addDirectoryToArchive(std::string f_path,
66 std::string f_destinationName, UI_8 f_depth =
67 CErrorEventArchive::MAX_DIRECTORY_DEPTH);
71 std::string m_pathAndName;
72 std::string m_tmpName;
74 static const UI_32 TARMODE = 0644;
77 #endif // LOGGER_SERVICE_SERVER_INCLUDE_SS_LOGGER_ERROR_EVENT_ARCHIVE_H_