1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_HIVIEWDFX_DATA_PUBLISHER_SYS_EVENT_CALLBACK_H 17 #define OHOS_HIVIEWDFX_DATA_PUBLISHER_SYS_EVENT_CALLBACK_H 18 19 #include <string> 20 #include <vector> 21 22 #include "iquery_base_callback.h" 23 24 namespace OHOS { 25 namespace HiviewDFX { 26 class DataPublisherSysEventCallback : public IQueryBaseCallback { 27 28 public: DataPublisherSysEventCallback(std::string srcPath,std::string destPath,int32_t fileIndex,int32_t totalJsonSize)29 DataPublisherSysEventCallback(std::string srcPath, std::string destPath, 30 int32_t fileIndex, int32_t totalJsonSize): srcPath_(srcPath), 31 destPath_(destPath), fileIndex_(fileIndex), totalJsonSize_(totalJsonSize){}; ~DataPublisherSysEventCallback()32 ~DataPublisherSysEventCallback() {}; 33 void OnQuery(const std::vector<std::u16string>& sysEvent, const std::vector<int64_t>& seq) override; 34 void OnComplete(int32_t reason, int32_t total, int64_t seq) override; 35 void HandleEventFile(const std::string &srcPath, const std::string &desPath); 36 37 private: 38 std::string srcPath_; 39 std::string destPath_; 40 std::string lastDestFilePath_; 41 int32_t fileIndex_; 42 int32_t totalJsonSize_; 43 }; 44 } // namespace HiviewDFX 45 } // namespace OHOS 46 47 #endif // OHOS_HIVIEWDFX_DATA_PUBLISHER_SYS_EVENT_CALLBACK_H 48 49