Code Review
/
common
/
thrift.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
1077ed6
)
THRIFT-1955 Union Type writer generated in C# does not WriteStructBegin
author
Jens Geyer
<jensg@apache.org>
Thu, 2 May 2013 17:29:42 +0000
(19:29 +0200)
committer
Jens Geyer
<jensg@apache.org>
Thu, 2 May 2013 17:29:42 +0000
(19:29 +0200)
Patch: Carl Yeksigian
compiler/cpp/src/generate/t_csharp_generator.cc
patch
|
blob
|
history
diff --git
a/compiler/cpp/src/generate/t_csharp_generator.cc
b/compiler/cpp/src/generate/t_csharp_generator.cc
index
f0972cf
..
90336a6
100644
(file)
--- a/
compiler/cpp/src/generate/t_csharp_generator.cc
+++ b/
compiler/cpp/src/generate/t_csharp_generator.cc
@@
-1027,6
+1027,9
@@
void t_csharp_generator::generate_csharp_union_class(std::ofstream& out, t_struc
indent(out) << "}" << endl;
indent(out) << "public override void Write(TProtocol oprot) {" << endl;
indent_up();
+ indent(out) << "TStruct struc = new TStruct(\"" << tunion->get_name() << "\");" << endl;
+ indent(out) << "oprot.WriteStructBegin(struc);" << endl;
+
indent(out) << "TField field = new TField();" << endl;
indent(out) << "field.Name = \"" << tfield->get_name() << "\";" << endl;
indent(out) << "field.Type = " << type_to_enum(tfield->get_type()) << ";" << endl;