added support for deprecated fields, reworded some todos

This commit is contained in:
Jan Tattermusch 2015-04-13 14:21:33 -07:00
parent 16a3e2b914
commit 8cec65e761
3 changed files with 6 additions and 8 deletions

View File

@ -73,7 +73,7 @@ void ExtensionGenerator::Generate(Writer* writer) {
SimpleItoa(descriptor_->number()));
if (use_lite_runtime()) {
// TODO(jtattermusch): check the argument...
// TODO(jtattermusch): include the following check
//if (Descriptor.MappedType == MappedType.Message && Descriptor.MessageType.Options.MessageSetWireFormat)
//{
// throw new ArgumentException(
@ -122,7 +122,7 @@ void ExtensionGenerator::GenerateStaticVariableInitializers(Writer* writer) {
}
writer->WriteLine("$0$,", default_val);
}
// TODO(jtattermusch):
// TODO(jtattermusch): include following snippet
//writer.WriteLine("{0},",
// (Descriptor.MappedType == MappedType.Message) ? type + ".DefaultInstance" : "null");
//writer.WriteLine("{0},",

View File

@ -61,11 +61,10 @@ FieldGeneratorBase::~FieldGeneratorBase() {
}
void FieldGeneratorBase::AddDeprecatedFlag(Writer* writer) {
// TODO(jtattermusch):
//if (IsObsolete)
//{
// writer.WriteLine("[global::System.ObsoleteAttribute()]");
//}
if (descriptor_->options().deprecated())
{
writer->WriteLine("[global::System.ObsoleteAttribute()]");
}
}
void FieldGeneratorBase::AddNullCheck(Writer* writer) {

View File

@ -81,7 +81,6 @@ MessageGenerator::~MessageGenerator() {
}
std::string MessageGenerator::class_name() {
// TODO: check correctness.
return descriptor_->name();
}