Refactor legacy C code for pkgmgr_event
[platform/core/appfw/data-provider-master.git] / src / pkgmgr_event_args.cc
1 /*
2  * Copyright (c) 2023 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #include "pkgmgr_event_args.hh"
18
19 namespace dpm {
20
21 PkgmgrEventArgs::PkgmgrEventArgs(uid_t target_uid, int req_id,
22     std::string pkg_type, std::string pkgid, std::string event_status,
23     std::string event_name)
24     : target_uid_(target_uid),
25       req_id_(req_id),
26       pkg_type_(std::move(pkg_type)),
27       pkgid_(std::move(pkgid)),
28       event_status_(std::move(event_status)),
29       event_name_(std::move(event_name)) {
30   tag_ = std::to_string(target_uid) + "-" + pkgid_;
31 }
32
33 uid_t PkgmgrEventArgs::GetTargetUid() const {
34   return target_uid_;
35 }
36
37 int PkgmgrEventArgs::GetReqId() const {
38   return req_id_;
39 }
40
41 const std::string& PkgmgrEventArgs::GetPkgType() const {
42   return pkg_type_;
43 }
44
45 const std::string& PkgmgrEventArgs::GetPkgId() const {
46   return pkgid_;
47 }
48
49 const std::string& PkgmgrEventArgs::GetEventStatus() const {
50   return event_status_;
51 }
52
53 const std::string& PkgmgrEventArgs::GetEventName() const {
54   return event_name_;
55 }
56
57 const std::string& PkgmgrEventArgs::GetTag() const {
58   return tag_;
59 }
60
61 }  // namespace dpm