added support for deprecated fields, reworded some todos
This commit is contained in:
parent
16a3e2b914
commit
8cec65e761
@ -73,7 +73,7 @@ void ExtensionGenerator::Generate(Writer* writer) {
|
|||||||
SimpleItoa(descriptor_->number()));
|
SimpleItoa(descriptor_->number()));
|
||||||
|
|
||||||
if (use_lite_runtime()) {
|
if (use_lite_runtime()) {
|
||||||
// TODO(jtattermusch): check the argument...
|
// TODO(jtattermusch): include the following check
|
||||||
//if (Descriptor.MappedType == MappedType.Message && Descriptor.MessageType.Options.MessageSetWireFormat)
|
//if (Descriptor.MappedType == MappedType.Message && Descriptor.MessageType.Options.MessageSetWireFormat)
|
||||||
//{
|
//{
|
||||||
// throw new ArgumentException(
|
// throw new ArgumentException(
|
||||||
@ -122,7 +122,7 @@ void ExtensionGenerator::GenerateStaticVariableInitializers(Writer* writer) {
|
|||||||
}
|
}
|
||||||
writer->WriteLine("$0$,", default_val);
|
writer->WriteLine("$0$,", default_val);
|
||||||
}
|
}
|
||||||
// TODO(jtattermusch):
|
// TODO(jtattermusch): include following snippet
|
||||||
//writer.WriteLine("{0},",
|
//writer.WriteLine("{0},",
|
||||||
// (Descriptor.MappedType == MappedType.Message) ? type + ".DefaultInstance" : "null");
|
// (Descriptor.MappedType == MappedType.Message) ? type + ".DefaultInstance" : "null");
|
||||||
//writer.WriteLine("{0},",
|
//writer.WriteLine("{0},",
|
||||||
|
@ -61,11 +61,10 @@ FieldGeneratorBase::~FieldGeneratorBase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FieldGeneratorBase::AddDeprecatedFlag(Writer* writer) {
|
void FieldGeneratorBase::AddDeprecatedFlag(Writer* writer) {
|
||||||
// TODO(jtattermusch):
|
if (descriptor_->options().deprecated())
|
||||||
//if (IsObsolete)
|
{
|
||||||
//{
|
writer->WriteLine("[global::System.ObsoleteAttribute()]");
|
||||||
// writer.WriteLine("[global::System.ObsoleteAttribute()]");
|
}
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FieldGeneratorBase::AddNullCheck(Writer* writer) {
|
void FieldGeneratorBase::AddNullCheck(Writer* writer) {
|
||||||
|
@ -81,7 +81,6 @@ MessageGenerator::~MessageGenerator() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string MessageGenerator::class_name() {
|
std::string MessageGenerator::class_name() {
|
||||||
// TODO: check correctness.
|
|
||||||
return descriptor_->name();
|
return descriptor_->name();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user