blob: 30daefb172f68cbe2e2318205e5fc9dbdd1f8f35 [file] [log] [blame]
David Sehr8c0961f2018-01-23 16:11:38 -08001/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include <string>
18
19#include "modifiers.h"
20
21namespace art {
22
23std::string PrettyJavaAccessFlags(uint32_t access_flags) {
24 std::string result;
25 if ((access_flags & kAccPublic) != 0) {
26 result += "public ";
27 }
28 if ((access_flags & kAccProtected) != 0) {
29 result += "protected ";
30 }
31 if ((access_flags & kAccPrivate) != 0) {
32 result += "private ";
33 }
34 if ((access_flags & kAccFinal) != 0) {
35 result += "final ";
36 }
37 if ((access_flags & kAccStatic) != 0) {
38 result += "static ";
39 }
40 if ((access_flags & kAccAbstract) != 0) {
41 result += "abstract ";
42 }
43 if ((access_flags & kAccInterface) != 0) {
44 result += "interface ";
45 }
46 if ((access_flags & kAccTransient) != 0) {
47 result += "transient ";
48 }
49 if ((access_flags & kAccVolatile) != 0) {
50 result += "volatile ";
51 }
52 if ((access_flags & kAccSynchronized) != 0) {
53 result += "synchronized ";
54 }
55 return result;
56}
57
58} // namespace art