• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 
17 #ifndef DATASHARE_PREDICATES_DEF_H
18 #define DATASHARE_PREDICATES_DEF_H
19 
20 #include <string>
21 #include <vector>
22 #include "datashare_predicates_object.h"
23 #include "datashare_predicates_objects.h"
24 namespace OHOS {
25 namespace DataShare {
26 typedef enum {
27     INVALID_OPERATION = 0x0,
28     EQUAL_TO,
29     NOT_EQUAL_TO,
30     GREATER_THAN,
31     LESS_THAN,
32     GREATER_THAN_OR_EQUAL_TO,
33     LESS_THAN_OR_EQUAL_TO,
34     AND,
35     OR,
36     IS_NULL,
37     IS_NOT_NULL,
38     SQL_IN,
39     NOT_IN,
40     LIKE,
41     UNLIKE,
42     ORDER_BY_ASC,
43     ORDER_BY_DESC,
44     LIMIT,
45     OFFSET,
46     BEGIN_WARP,
47     END_WARP,
48     BEGIN_WITH,
49     END_WITH,
50     IN_KEY,
51     DISTINCT,
52     GROUP_BY,
53     INDEXED_BY,
54     CONTAINS,
55     GLOB,
56     BETWEEN,
57     NOTBETWEEN,
58     KEY_PREFIX,
59     LAST_TYPE
60 } OperationType;
61 
62 typedef struct {
63     OperationType operation;
64     std::vector<DataSharePredicatesObject> singleParams;
65     std::vector<DataSharePredicatesObjects> multiParams;
66 } OperationItem;
67 
68 typedef enum {
69     INVALID_MODE,
70     QUERY_LANGUAGE,
71     PREDICATES_METHOD
72 } SettingMode;
73 } // namespace DataShare
74 } // namespace OHOS
75 
76 #endif
77