1 /* 2 * Copyright (c) 2022 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_AST_ATTRIBUTE_H 10 #define OHOS_HDI_AST_ATTRIBUTE_H 11 12 #include "ast/ast_node.h" 13 14 namespace OHOS { 15 namespace HDI { 16 class ASTTypeAttr : public ASTNode { 17 public: 18 std::string ToString() const override; 19 20 std::string Dump(const std::string &prefix) override; 21 22 public: 23 bool isFull_ = false; 24 bool isLite_ = false; 25 }; 26 27 class ASTInfAttr : public ASTNode { 28 public: 29 std::string ToString() const override; 30 31 std::string Dump(const std::string &prefix) override; 32 33 public: 34 bool isFull_ = false; 35 bool isLite_ = false; 36 bool isCallback_ = false; 37 bool isOneWay_ = false; 38 }; 39 40 class ASTMethodAttr : public ASTNode { 41 public: 42 std::string ToString() const override; 43 44 std::string Dump(const std::string &prefix) override; 45 46 public: 47 bool isFull_ = false; 48 bool isLite_ = false; 49 bool isOneWay_ = false; 50 }; 51 52 enum class ParamAttr { 53 PARAM_IN, 54 PARAM_OUT, 55 }; 56 57 class ASTParamAttr : public ASTNode { 58 public: ASTParamAttr(ParamAttr value)59 ASTParamAttr(ParamAttr value) : ASTNode(), value_(value) {} 60 61 std::string ToString() const override; 62 63 std::string Dump(const std::string &prefix) override; 64 65 public: 66 ParamAttr value_; 67 }; 68 } // namespace HDI 69 } // namespace OHOS 70 71 #endif // OHOS_HDI_AST_ATTRIBUTE_H