• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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;
27     SecurityEvent(int64_t eventId, const std::string &version = "",
28         const std::string &content = "", const std::string &timestamp = "", int32_t userId = -1)
eventId_(eventId)29         : eventId_(eventId), version_(version), content_(content), timestamp_(timestamp), userId_(userId) {};
30     ~SecurityEvent() override = default;
31 
GetEventId()32     int64_t GetEventId() const { return eventId_; };
GetVersion()33     std::string GetVersion() const { return version_; };
GetContent()34     std::string GetContent() const { return content_; };
GetTimestamp()35     std::string GetTimestamp() const { return timestamp_; };
GetUserId()36     int32_t GetUserId() const { return userId_; };
Marshalling(Parcel & parcel)37     bool Marshalling(Parcel& parcel) const override { return true; };
ReadFromParcel(Parcel & parcel)38     bool ReadFromParcel(Parcel &parcel) { return true; };
Unmarshalling(Parcel & parcel)39     static SecurityEvent* Unmarshalling(Parcel& parcel) { return {}; };
40 
41 private:
42     int64_t eventId_;
43     std::string version_;
44     std::string content_;
45     std::string timestamp_;
46     int32_t userId_;
47 };
48 } // namespace OHOS::Security::SecurityCollector
49 
50 #endif // SECURITY_COLLECTOR_SECURITY_EVENT_H
51