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 #ifndef OHOS_IDL_SA_BYTETYPE_EMITTER_H 16 #define OHOS_IDL_SA_BYTETYPE_EMITTER_H 17 18 #include "codegen/SA/sa_type_emitter.h" 19 20 namespace OHOS { 21 namespace Idl { 22 class SaByteTypeEmitter : public SaTypeEmitter { 23 public: 24 TypeKind GetTypeKind() override; 25 26 std::string EmitCppType(TypeMode mode = TypeMode::NO_MODE) const override; 27 28 std::string EmitRustType(bool pt = false, TypeMode mode = TypeMode::NO_MODE) const override; 29 30 std::string EmitTsType(TypeMode mode = TypeMode::NO_MODE) const override; 31 32 void EmitCppWriteVar(const std::string &parcelName, const std::string &name, StringBuilder &sb, 33 const std::string &prefix) const override; 34 35 void EmitCppReadVar(const std::string &parcelName, const std::string &name, StringBuilder &sb, 36 const std::string &prefix, bool emitType) const override; 37 38 void EmitTsWriteVar(const std::string &parcelName, const std::string &name, StringBuilder &sb, 39 const std::string &prefix) const override; 40 41 void EmitTsReadVar(const std::string &parcelName, const std::string &name, StringBuilder &sb, 42 const std::string &prefix, TypeMode mode = TypeMode::NO_MODE) const override; 43 }; 44 } // namespace Idl 45 } // namespace OHOS 46 47 #endif // OHOS_IDL_SA_BYTETYPE_EMITTER_H