• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023-2024 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_CLOUD_DISK_SERVICE_FILE_COLUMN_H
17 #define OHOS_CLOUD_DISK_SERVICE_FILE_COLUMN_H
18 
19 #include <vector>
20 
21 #include "clouddisk_db_const.h"
22 
23 namespace OHOS {
24 namespace FileManagement {
25 namespace CloudDisk {
26 class FileColumn {
27 public:
28     // Local And Cloud
29     static const std::string CLOUD_ID;
30     static const std::string IS_DIRECTORY;
31     static const std::string FILE_NAME;
32     static const std::string PARENT_CLOUD_ID;
33     static const std::string FILE_SIZE;
34     static const std::string FILE_SHA256;
35     static const std::string FILE_TIME_ADDED;
36     static const std::string FILE_TIME_EDITED;
37     static const std::string FILE_TIME_RECYCLED;
38     static const std::string META_TIME_EDITED;
39     static const std::string DIRECTLY_RECYCLED;
40     static const std::string VERSION;
41     static const std::string OPERATE_TYPE;
42     static const std::string FILE_STATUS;
43     static const std::string ROW_ID;
44     static const std::string CHECK_FLAG;
45     static const std::string ROOT_DIRECTORY;
46     static const std::string ATTRIBUTE;
47 
48     // Only Local
49     static const std::string FILE_TIME_VISIT;
50     static const std::string SYNC_STATUS;
51     static const std::string POSITION;
52     static const std::string DIRTY_TYPE;
53     static const std::string THM_FLAG;
54     static const std::string LCD_FLAG;
55     static const std::string MIME_TYPE;
56     static const std::string FILE_TYPE;
57     static const std::string FILE_CATEGORY;
58     static const std::string IS_FAVORITE;
59     static const std::string NO_NEED_UPLOAD;
60     static const std::string SRC_CLOUD_ID;
61     static const std::string THM_SIZE;
62     static const std::string LCD_SIZE;
63     static const std::string SOURCE_CLOUD_ID;
64     static const std::string LOCAL_FLAG;
65 
66     /*  description for LOCAL_FLAG shift
67      *   |-----------------------bit 63 ~ 1 -------------|---bit 0----|
68      *   |--------------------------reserved-------------|-isConflict-|
69     */
70     static const uint64_t LOCAL_FLAG_MASK_ISCONFLICT;
71 
72     // table name
73     static const std::string FILES_TABLE;
74 
75     // parentCloudId index
76     static const std::string PARENT_CLOUD_ID_INDEX;
77 
78     // create FileTable sql
79     static const std::string CREATE_FILE_TABLE;
80 
81     // create parentCloudId index
82     static const std::string CREATE_PARENT_CLOUD_ID_INDEX;
83 
84     //create IsFavorite
85     static const std::string ADD_IS_FAVORITE;
86 
87     //create FileStatus
88     static const std::string ADD_FILE_STATUS;
89 
90     //set FileStatus
91     static const std::string SET_FILE_STATUS_DEFAULT;
92 
93     //set CheckFlag
94     static const std::string ADD_CHECK_FLAG;
95 
96     // set attribute
97     static const std::string ADD_ATTRIBUTE;
98 
99     // set thm
100     static const std::string ADD_THM_FLAG;
101 
102     static const std::string ADD_LCD_FLAG;
103 
104     static const std::string ADD_UPLOAD_FLAG;
105 
106     static const std::string ADD_THM_SIZE;
107 
108     static const std::string ADD_LCD_SIZE;
109 
110     static const std::string ADD_SOURCE_CLOUD_ID;
111 
112     // Add copy field
113     static const std::string ADD_SRC_CLOUD_ID;
114 
115     static const std::string ADD_LOCAL_FLAG;
116 
117     // Query FILES_TABLE for FileSystem
118     static const std::vector<std::string> FILE_SYSTEM_QUERY_COLUMNS;
119 
120     // Query FILES_TABLE for Disk Push
121     static const std::vector<std::string> DISK_CLOUD_SYNC_COLUMNS;
122 
123     static const std::vector<std::string> LOCAL_COLUMNS;
124 
125     // Query pull info columns
126     static const std::vector<std::string> PULL_QUERY_COLUMNS;
127 
128     // Query local info columns
129     static const std::vector<std::string> DISK_ON_UPLOAD_COLUMNS;
130 
131     static const std::vector<std::string> EXT_ATTR_QUERY_COLUMNS;
132 
133     // Query FILES_TABLE for CopyFile
134     static const std::vector<std::string> DISK_CLOUD_FOR_COPY;
135 
136     // Query FILES_TABLE for ThmInsert
137     static const std::vector<std::string> DISK_CLOUD_FOR_THM_INSERT;
138 };
139 } // namespace CloudDisk
140 } // namespace FileManagement
141 } // namespace OHOS
142 #endif // OHOS_CLOUD_DISK_SERVICE_FILE_COLUMN_H