Debian Codegraph @

native/common/include/jp_modifier.h

raw symbols SCIP
1 /*****************************************************************************
2 Licensed under the Apache License, Version 2.0 (the "License");
3 you may not use this file except in compliance with the License.
4 You may obtain a copy of the License at
5
6 http://www.apache.org/licenses/LICENSE-2.0
7
8 Unless required by applicable law or agreed to in writing, software
9 distributed under the License is distributed on an "AS IS" BASIS,
10 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 See the License for the specific language governing permissions and
12 limitations under the License.
13
14 See NOTICE file for details.
15 *****************************************************************************/
16 #ifndef JP_MODIFIER_H
17 #define JP_MODIFIER_H
18
19 #ifdef __cplusplus
20 extern "C"
21 {
22 #endif
23
24 namespace JPModifier
25 {
26
27 /* https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-4.html#jvms-4.1-200-E.1
28 * https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-4.html#jvms-4.5-200-A.1
29 * https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-4.html#jvms-4.6-200-A.1
30 */
31
32 inline bool isPublic(jlong modifier)
33 {
34 return (modifier & 0x0001) == 0x0001;
35 }
36
37 inline bool isPrivate(jlong modifier)
38 {
39 return (modifier & 0x0002) == 0x0002;
40 }
41
42 inline bool isProtected(jlong modifier)
43 {
44 return (modifier & 0x0004) == 0x0004;
45 }
46
47 inline bool isStatic(jlong modifier)
48 {
49 return (modifier & 0x0008) == 0x0008;
50 }
51
52 inline bool isFinal(jlong modifier)
53 {
54 return (modifier & 0x0010) == 0x0010;
55 }
56
57 inline bool isSuper(jlong modifier)
58 {
59 return (modifier & 0x0020) == 0x0020;
60 }
61
62 inline bool isVolatile(jlong modifier)
63 {
64 return (modifier & 0x0040) == 0x0040;
65 } // fields
66
67 inline bool isBridge(jlong modifier)
68 {
69 return (modifier & 0x0040) == 0x0040;
70 } // methods
71
72 inline bool isTransient(jlong modifier)
73 {
74 return (modifier & 0x0080) == 0x0080;
75 } // fields
76
77 inline bool isVarArgs(jlong modifier)
78 {
79 return (modifier & 0x0080) == 0x0080;
80 } //methods
81
82 inline bool isNative(jlong modifier)
83 {
84 return (modifier & 0x0100) == 0x0100;
85 }
86
87 inline bool isInterface(jlong modifier)
88 {
89 return (modifier & 0x0200) == 0x0200;
90 }
91
92 inline bool isAbstract(jlong modifier)
93 {
94 return (modifier & 0x0400) == 0x0400;
95 }
96
97 inline bool isStrict(jlong modifier)
98 {
99 return (modifier & 0x0800) == 0x0800;
100 }
101
102 inline bool isSynthetic(jlong modifier)
103 {
104 return (modifier & 0x1000) == 0x1000;
105 }
106
107 inline bool isAnnotation(jlong modifier)
108 {
109 return (modifier & 0x2000) == 0x2000;
110 }
111
112 inline bool isEnum(jlong modifier)
113 {
114 return (modifier & 0x4000) == 0x4000;
115 }
116
117 inline bool isModule(jlong modifier)
118 {
119 return (modifier & 0x8000) == 0x8000;
120 }
121
122 /* JPype flags (must match ModifierCodes sections)
123 */
124 inline bool isSpecial(jlong modifier)
125 {
126 return (modifier & 0x00010000) == 0x00010000;
127 }
128
129 inline bool isThrowable(jlong modifier)
130 {
131 return (modifier & 0x00020000) == 0x00020000;
132 }
133
134 inline bool isSerializable(jlong modifier)
135 {
136 return (modifier & 0x00040000) == 0x00040000;
137 }
138
139 inline bool isAnonymous(jlong modifier)
140 {
141 return (modifier & 0x00080000) == 0x00080000;
142 }
143
144 inline bool isFunctional(jlong modifier)
145 {
146 return (modifier & 0x00100000) == 0x00100000;
147 }
148
149 inline bool isCallerSensitive(jlong modifier)
150 {
151 return (modifier & 0x00200000) == 0x00200000;
152 }
153
154 inline bool isPrimitiveArray(jlong modifier)
155 {
156 return (modifier & 0x00400000) == 0x00400000;
157 }
158
159 inline bool isComparable(jlong modifier)
160 {
161 return (modifier & 0x00800000) == 0x00800000;
162 }
163
164 inline bool isBuffer(jlong modifier)
165 {
166 return (modifier & 0x01000000) == 0x01000000;
167 }
168
169 inline bool isConstructor(jlong modifier)
170 {
171 return (modifier & 0x10000000) == 0x10000000;
172 }
173
174 inline bool isBeanAccessor(jlong modifier)
175 {
176 return (modifier & 0x20000000) == 0x20000000;
177 }
178
179 inline bool isBeanMutator(jlong modifier)
180 {
181 return (modifier & 0x40000000) == 0x40000000;
182 }
183 }
184
185 #ifdef __cplusplus
186 }
187 #endif
188 #endif /* JP_MODIFIER_H */