blob: 4893c8b76041ce887b0387292547bfe959ce2e28 [file] [log] [blame]
Ryan Mitchell833a1a62018-07-10 13:51:36 -07001/*
2 * Copyright (C) 2018 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#ifndef AAPT2_DUMP_H
18#define AAPT2_DUMP_H
19
20#include "Command.h"
21#include "Debug.h"
22
23namespace aapt {
24
25struct DumpOptions {
26 DebugPrintTableOptions print_options;
27
28 // The path to a file within an APK to dump.
29 Maybe<std::string> file_to_dump_path;
30};
31
32class DumpCommand : public Command {
33 public:
34 DumpCommand() : Command("dump", "d") {
35 SetDescription("Prints resource and manifest information.");
36 AddOptionalSwitch("--no-values", "Suppresses output of values when displaying resource tables.",
37 &no_values_);
38 AddOptionalFlag("--file", "Dumps the specified file from the APK passed as arg.",
39 &options_.file_to_dump_path);
40 AddOptionalSwitch("-v", "increase verbosity of output", &verbose_);
41 }
42
43 int Action(const std::vector<std::string>& args) override;
44
45 private:
46 DumpOptions options_;
47
48 bool verbose_ = false;
49 bool no_values_ = false;
50};
51
52}// namespace aapt
53
54#endif //AAPT2_DUMP_H