• 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 #ifndef HISTORY_INFO_MGR_H
16 #define HISTORY_INFO_MGR_H
17 
18 #include <vector>
19 #include "service_db_helper.h"
20 #include "nocopyable.h"
21 
22 namespace OHOS {
23 namespace IntellVoiceUtils {
24 class HistoryInfoMgr : private ServiceDbHelper {
25 public:
26     HistoryInfoMgr();
27     ~HistoryInfoMgr() = default;
28 
GetInstance()29     static HistoryInfoMgr& GetInstance()
30     {
31         static HistoryInfoMgr historyInfoMgr;
32         return historyInfoMgr;
33     }
34 
35     void SetIntKVPair(std::string key, int32_t value);
36     int32_t GetIntKVPair(std::string key);
37     void SetStringKVPair(std::string key, std::string value);
38     std::string GetStringKVPair(std::string key);
39     void DeleteKey(const std::vector<std::string> &keyList);
40 
41 private:
42     DISALLOW_COPY_AND_MOVE(HistoryInfoMgr);
43 };
44 }
45 }
46 #endif