Add to cache pkg & appinfo
[platform/core/appfw/pkgmgr-info.git] / src / server / request_handler / get_pkginfo_request_handler.hh
1 // Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache-2.0 license that can be
3 // found in the LICENSE file.
4
5 #ifndef SERVER_GET_PKGINFO_REQUEST_HANDLER_HH_
6 #define SERVER_GET_PKGINFO_REQUEST_HANDLER_HH_
7
8 #include "abstract_request_handler.hh"
9 #include "pkginfo_parcelable.hh"
10
11 #include <string>
12
13 namespace pkgmgr_server {
14 namespace request_handler {
15
16 #ifndef EXPORT_API
17 #define EXPORT_API __attribute__((visibility("default")))
18 #endif
19
20 class EXPORT_API GetPkginfoRequestHandler : public AbstractRequestHandler {
21  public:
22   explicit GetPkginfoRequestHandler(bool cache = false);
23   bool HandleRequest(unsigned char* data, int size,
24       const std::string& locale) override;
25
26   std::vector<uint8_t> ExtractResult() override;
27
28  private:
29   std::shared_ptr<pkgmgr_common::parcel::PkgInfoParcelable> result_;
30   bool cache_;
31 };
32
33 }  // namespace request_handler
34 }  // namespace pkgmgr_server
35
36 #endif  // SERVER_GET_PKGINFO_REQUEST_HANDLER_HH_