2 * Copyright (C) 2015 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef AAPT_RESOURCE_TYPE_EXTENSIONS_H
18 #define AAPT_RESOURCE_TYPE_EXTENSIONS_H
20 #include <androidfw/ResourceTypes.h>
25 * New android::ResChunk_header types defined
28 * TODO(adamlesinski): Consider reserving these
29 * enums in androidfw/ResourceTypes.h to avoid
34 * A chunk that holds the string pool
35 * for source entries (path/to/source:line).
37 RES_TABLE_SOURCE_POOL_TYPE = 0x000e,
40 * A chunk holding names of externally
41 * defined symbols and offsets to where
42 * they are referenced in the table.
44 RES_TABLE_SYMBOL_TABLE_TYPE = 0x000f,
48 * New resource types that are meant to only be used
49 * by AAPT and will not end up on the device.
51 struct ExtendedTypes {
54 * A sentinel value used when a resource is defined as
55 * public but it has no defined value yet. If we don't
56 * flatten it with some value, we will lose its name.
61 * A raw string value that hasn't had its escape sequences
62 * processed nor whitespace removed.
64 TYPE_RAW_STRING = 0xfe
69 * A chunk with type RES_TABLE_SYMBOL_TABLE_TYPE.
70 * Following the header are count number of SymbolTable_entry
71 * structures, followed by an android::ResStringPool_header.
73 struct SymbolTable_header {
74 android::ResChunk_header header;
77 * Number of SymbolTable_entry structures following
83 struct SymbolTable_entry {
85 * Offset from the beginning of the resource table
86 * where the symbol entry is referenced.
91 * The index into the string pool where the name of this
98 * A structure representing the source of a resourc entry.
99 * Appears after an android::ResTable_entry or android::ResTable_map_entry.
101 * TODO(adamlesinski): This causes some issues when runtime code checks
102 * the size of an android::ResTable_entry. It assumes it is an
103 * android::ResTable_map_entry if the size is bigger than an android::ResTable_entry
104 * which may not be true if this structure is present.
106 struct ResTable_entry_source {
108 * Index into the source string pool.
113 * Line number this resource was defined on.
120 #endif // AAPT_RESOURCE_TYPE_EXTENSIONS_H