blob: d13333bb188985d6f5472e4c5da52b3a94c4b857 [file] [log] [blame]
Mathieu Chartierf95a75e2017-11-03 15:25:52 -07001/*
2 * Copyright (C) 2017 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 * Header file of an in-memory representation of DEX files.
17 */
18
19#ifndef ART_DEXLAYOUT_COMPACT_DEX_WRITER_H_
20#define ART_DEXLAYOUT_COMPACT_DEX_WRITER_H_
21
22#include "dex_writer.h"
23
24namespace art {
25
26class CompactDexWriter : public DexWriter {
27 public:
Mathieu Chartier3e0c5172017-11-12 12:58:40 -080028 CompactDexWriter(dex_ir::Header* header,
29 MemMap* mem_map,
30 DexLayout* dex_layout,
31 CompactDexLevel compact_dex_level)
32 : DexWriter(header, mem_map, dex_layout, /*compute_offsets*/ true),
33 compact_dex_level_(compact_dex_level) {}
Mathieu Chartierf95a75e2017-11-03 15:25:52 -070034
35 protected:
36 void WriteHeader() OVERRIDE;
37
Mathieu Chartierf6e31472017-12-28 13:32:08 -080038 size_t GetHeaderSize() const OVERRIDE;
39
Mathieu Chartierf95a75e2017-11-03 15:25:52 -070040 const CompactDexLevel compact_dex_level_;
41
42 private:
43 DISALLOW_COPY_AND_ASSIGN(CompactDexWriter);
44};
45
46} // namespace art
47
48#endif // ART_DEXLAYOUT_COMPACT_DEX_WRITER_H_