1 /* 2 * Copyright (c) 2024 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 SECURITY_COLLECTOR_SECURITY_EVENT_H 17 #define SECURITY_COLLECTOR_SECURITY_EVENT_H 18 19 #include <string> 20 21 #include "parcel.h" 22 23 namespace OHOS::Security::SecurityCollector { 24 class SecurityEvent : public Parcelable { 25 public: 26 SecurityEvent() = default; SecurityEvent(int64_t eventId, const std::string &version = �, const std::string &content = �, const std::string ×tamp = �)27 SecurityEvent(int64_t eventId, const std::string &version = "", 28 const std::string &content = "", const std::string ×tamp = "") 29 : eventId_(eventId), version_(version), content_(content), timestamp_(timestamp) {}; 30 ~SecurityEvent() override = default; 31 GetEventId() const32 int64_t GetEventId() const { return eventId_; }; GetVersion() const33 std::string GetVersion() const { return version_; }; GetContent() const34 std::string GetContent() const { return content_; }; GetTimestamp() const35 std::string GetTimestamp() const { return timestamp_; }; 36 bool Marshalling(Parcel& parcel) const override; 37 bool ReadFromParcel(Parcel &parcel); 38 static SecurityEvent* Unmarshalling(Parcel& parcel); 39 40 private: 41 int64_t eventId_; 42 std::string version_; 43 std::string content_; 44 std::string timestamp_; 45 }; 46 } // namespace OHOS::Security::SecurityCollector 47 48 #endif // SECURITY_COLLECTOR_SECURITY_EVENT_H 49