1 /** 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 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 16 #ifndef ABC2PROGRAM_ABC_METHOD_PROCESSOR_H 17 #define ABC2PROGRAM_ABC_METHOD_PROCESSOR_H 18 19 #include "abc_file_entity_processor.h" 20 #include "method_data_accessor-inl.h" 21 22 namespace ark::abc2program { 23 24 class AbcMethodProcessor : public AbcFileEntityProcessor { 25 public: 26 AbcMethodProcessor(panda_file::File::EntityId entityId, Abc2ProgramKeyData &keyData); 27 void GetMethodName(); 28 void GetMethodCode(); 29 void FillProgramData(); 30 std::string GetMethodSignature(); 31 32 private: 33 pandasm::Function function_; 34 void GetParams(const panda_file::File::EntityId &protoId); 35 void GetMetaData(); 36 pandasm::Type PFTypeToPandasmType(const panda_file::Type &type, panda_file::ProtoDataAccessor &pda, 37 size_t &refIdx) const; 38 void FillFunction(); 39 std::unique_ptr<panda_file::MethodDataAccessor> methodDataAccessor_; 40 std::string methodSignature_; 41 }; 42 43 } // namespace ark::abc2program 44 45 #endif // ABC2PROGRAM_ABC_METHOD_PROCESSOR_H 46