1 /* 2 * Copyright (C) 2021, The Android Open Source Project * 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #pragma once 16 17 #include "aidl_language.h" 18 #include "code_writer.h" 19 20 namespace android { 21 namespace aidl { 22 23 struct DumpVisitor : AidlVisitor { 24 CodeWriter& out; DumpVisitorDumpVisitor25 DumpVisitor(CodeWriter& out) : out(out) {} 26 27 void DumpType(const AidlDefinedType& dt, const string& type); 28 void DumpMembers(const AidlDefinedType& dt); 29 void DumpComments(const AidlCommentable& c); 30 void DumpAnnotations(const AidlAnnotatable& a); 31 virtual void DumpConstantValue(const AidlTypeSpecifier& type, const AidlConstantValue& c); 32 33 void Visit(const AidlInterface& t) override; 34 void Visit(const AidlParcelable& t) override; 35 void Visit(const AidlStructuredParcelable& t) override; 36 void Visit(const AidlUnionDecl& t) override; 37 void Visit(const AidlEnumDeclaration& t) override; 38 void Visit(const AidlMethod& m) override; 39 void Visit(const AidlVariableDeclaration& v) override; 40 void Visit(const AidlConstantDeclaration& c) override; 41 void Visit(const AidlEnumerator& e) override; 42 void Visit(const AidlTypeSpecifier& t) override; 43 }; 44 45 bool dump_api(const Options& options, const IoDelegate& io_delegate); 46 47 } // namespace aidl 48 } // namespace android 49