• 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_COMMON_H
17 #define OHOS_HIVIEWDFX_DATA_SHARE_COMMON_H
18 
19 namespace OHOS {
20 namespace HiviewDFX {
21 
22 constexpr const char* TIME_STAMP_FORMAT = "%Y%m%d%H%M%S";
23 constexpr const char* BUNDLE_UNINSTALL = "BUNDLE_UNINSTALL";
24 constexpr const char* BUNDLE_NAME = "BUNDLE_NAME";
25 constexpr const char* DOMAIN = "Domain";
26 constexpr const char* FILE_SUFFIX = ".evt";
27 constexpr const char* DOMAIN_PATH = "/Domain-";
28 constexpr const char* PATH_DIR = "/data/log/hiview/system_event_db/events/";
29 constexpr const char* TEMP_SRC_DIR = "/data/log/hiview/system_event_db/events/eventTemp.evt";
30 constexpr const char* TEMP_EXPORT_SRC_DIR = "/data/log/hiview/system_event_db/events/eventExportTemp.evt";
31 constexpr const char* DATABASE_DIR = "/data/log/hiview/system_event_db/subscribers/";
32 
33 constexpr const char* SUCCESS_CODE = "000";
34 constexpr const char* QUERY_FAILED_CODE = "001";
35 
36 constexpr const char* DATABASE_NAME = "subscribers.db";
37 constexpr const char* SQL_TEXT_TYPE = "TEXT NOT NULL";
38 constexpr const char* SQL_INT_TYPE = "INTEGER NOT NULL";
39 constexpr const char* SQL_BIGINT_TYPE = "BIGINT NOT NULL";
40 
41 constexpr int MAXIMUM_FILE_SIZE = 1024 * 1024 * 5;  // Maximum file size 5M at one time
42 constexpr int MAXIMUM_EVENT_SIZE = 1024 * 768;      // Maximum event 768K
43 constexpr int DELAY_TIME = 2; // delay 2s
44 
45 namespace SubscribeStore {
46 constexpr int DB_SUCC = 0;
47 constexpr int DB_FAILED = -1;
48 
49 namespace EventTable {
50 constexpr const char* TABLE = "subscribe_events";
51 constexpr const char* FIELD_ID = "id";
52 constexpr const char* FIELD_UID = "uid";
53 constexpr const char* FIELD_BUNDLE_NAME = "bundle_name";
54 constexpr const char* FIELD_SUBSCRIBETIME = "subscribe_time";
55 constexpr const char* FIELD_EVENTLIST = "event_list";
56 }  // namespace EventTable
57 
58 }  // namespace SubscribeStore
59 
60 }  // namespace HiviewDFX
61 }  // namespace OHOS
62 
63 #endif  // OHOS_HIVIEWDFX_DATA_SHARE_COMMON_H
64