• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_SHARE_DAO_H
17 #define OHOS_HIVIEWDFX_DATA_SHARE_DAO_H
18 
19 #include <map>
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 #include "data_share_common.h"
25 
26 namespace OHOS {
27 namespace HiviewDFX {
28 
29 class DataShareStore;
30 
31 class DataShareDao {
32 public:
33     DataShareDao(std::shared_ptr<DataShareStore> store);
~DataShareDao()34     ~DataShareDao() {}
35     int SaveSubscriberInfo(int32_t uid, const std::string &events);
36     int DeleteSubscriberInfo(int32_t uid);
37     bool IsUidExists(int32_t uid);
38     int GetEventListByUid(int32_t uid, std::string &events);
39     int GetUidByBundleName(const std::string &bundleName, int32_t &uid);
40     int GetTotalSubscriberInfo(std::map<int, std::string> &map);
41 
42 private:
43     std::shared_ptr<DataShareStore> store_;
44     std::string eventTable_;
45 };
46 
47 }  // namespace HiviewDFX
48 }  // namespace OHOS
49 
50 #endif  // OHOS_HIVIEWDFX_DATA_SHARE_DAO_H
51