From 1ec9cc0790b6e748161063b00c0ba2c0aed66990 Mon Sep 17 00:00:00 2001 From: guanshoukui Date: Thu, 7 Mar 2024 21:58:45 +0800 Subject: [PATCH] temp --- src/struct_pb/protoc-plugin/FileGenerator.cpp | 4 ++-- src/struct_pb/protoc-plugin/MessageGenerator.cpp | 2 +- src/struct_pb/protoc-plugin/example/base.proto | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/struct_pb/protoc-plugin/FileGenerator.cpp b/src/struct_pb/protoc-plugin/FileGenerator.cpp index 41183d506..c4b1f4e0d 100644 --- a/src/struct_pb/protoc-plugin/FileGenerator.cpp +++ b/src/struct_pb/protoc-plugin/FileGenerator.cpp @@ -82,7 +82,7 @@ IGUANA_INLINE void from_json_impl(Eigen::Quaternion<_Scalar>& value, It&& it, It iguana::from_json(*(_Scalar(*)[4]) & value, it, end); } -})"); +}// namespace eigen)"); } @@ -99,8 +99,8 @@ void FileGenerator::generate_enum_helper(google::protobuf::io2::Printer *p) { for(int i = 0; i < msg->value_count();++i) { format("$1$, ", msg->value(i)->number()); } - format("};\n};\n"); format.outdent(); + format("};\n};\n"); } NamespaceOpener(p, "iguana").close(); diff --git a/src/struct_pb/protoc-plugin/MessageGenerator.cpp b/src/struct_pb/protoc-plugin/MessageGenerator.cpp index 3f57b9c74..283c0d25b 100644 --- a/src/struct_pb/protoc-plugin/MessageGenerator.cpp +++ b/src/struct_pb/protoc-plugin/MessageGenerator.cpp @@ -61,7 +61,7 @@ void MessageGenerator::generate_struct_definition( for (int i = 0; i < d_->field_count(); ++i) { auto fd = d_->field(i); if (fd->options().GetExtension(inherits_from)) { - parent = std::string(": public ") + fg_map_.get(fd).cpp_type_name(); + parent += (i == 0 ? ":" : ",") + std::string(" public ") + fg_map_.get(fd).cpp_type_name(); } } diff --git a/src/struct_pb/protoc-plugin/example/base.proto b/src/struct_pb/protoc-plugin/example/base.proto index 7efa45d7b..2791fe8a7 100644 --- a/src/struct_pb/protoc-plugin/example/base.proto +++ b/src/struct_pb/protoc-plugin/example/base.proto @@ -121,4 +121,3 @@ message PointENU { double y = 2 ; double z = 3 ; } -