1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * 4 * HDF is dual licensed: you can use it either under the terms of 5 * the GPL, or the BSD license, at your option. 6 * See the LICENSE file in the root of this repository for complete details. 7 */ 8 9 #ifndef OHOS_HDI_ASTSEQUENCEABLETYPE_H 10 #define OHOS_HDI_ASTSEQUENCEABLETYPE_H 11 12 #include "ast/ast_type.h" 13 14 namespace OHOS { 15 namespace HDI { 16 class ASTSequenceableType : public ASTType { 17 public: ASTSequenceableType()18 ASTSequenceableType() : ASTType(TypeKind::TYPE_SEQUENCEABLE, false) {} 19 20 void SetNamespace(const AutoPtr<ASTNamespace> &nspace) override; 21 22 bool IsSequenceableType() override; 23 24 std::string Dump(const std::string &prefix) override; 25 26 TypeKind GetTypeKind() override; 27 28 std::string GetFullName() const; 29 30 std::string EmitCType(TypeMode mode = TypeMode::NO_MODE) const override; 31 32 std::string EmitCppType(TypeMode mode = TypeMode::NO_MODE) const override; 33 34 std::string EmitJavaType(TypeMode mode, bool isInnerType = false) const override; 35 36 void EmitCppWriteVar(const std::string &parcelName, const std::string &name, StringBuilder &sb, 37 const std::string &prefix, unsigned int innerLevel = 0) const override; 38 39 void EmitCppReadVar(const std::string &parcelName, const std::string &name, StringBuilder &sb, 40 const std::string &prefix, bool initVariable, unsigned int innerLevel = 0) const override; 41 42 void EmitCppMarshalling(const std::string &parcelName, const std::string &name, StringBuilder &sb, 43 const std::string &prefix, unsigned int innerLevel = 0) const override; 44 45 void EmitCppUnMarshalling(const std::string &parcelName, const std::string &name, StringBuilder &sb, 46 const std::string &prefix, bool emitType, unsigned int innerLevel = 0) const override; 47 48 void EmitJavaWriteVar(const std::string &parcelName, const std::string &name, StringBuilder &sb, 49 const std::string &prefix) const override; 50 51 void EmitJavaReadVar(const std::string &parcelName, const std::string &name, StringBuilder &sb, 52 const std::string &prefix) const override; 53 54 void EmitJavaReadInnerVar(const std::string &parcelName, const std::string &name, bool isInner, StringBuilder &sb, 55 const std::string &prefix) const override; 56 }; 57 } // namespace HDI 58 } // namespace OHOS 59 60 #endif // OHOS_HDI_ASTSEQUENCEABLETYPE_H