Register that the C# compiler supports proto3 presence.

(It doesn't yet, but will in the next commits...)
This commit is contained in:
Jon Skeet 2020-04-15 11:39:28 +01:00 committed by Jon Skeet
parent 7eddac7877
commit 4c9613f226
2 changed files with 15 additions and 5 deletions

View File

@ -48,6 +48,13 @@ namespace protobuf {
namespace compiler {
namespace csharp {
Generator::Generator() {}
Generator::~Generator() {}
uint64 Generator::GetSupportedFeatures() const {
return CodeGenerator::Feature::FEATURE_PROTO3_OPTIONAL;
}
void GenerateFile(const FileDescriptor* file, io::Printer* printer,
const Options* options) {
ReflectionClassGenerator reflectionClassGenerator(file, options);

View File

@ -50,11 +50,14 @@ namespace csharp {
// CodeGenerator with the CommandLineInterface in your main() function.
class PROTOC_EXPORT Generator : public CodeGenerator {
public:
virtual bool Generate(
const FileDescriptor* file,
const string& parameter,
GeneratorContext* generator_context,
string* error) const;
Generator();
~Generator();
bool Generate(
const FileDescriptor* file,
const string& parameter,
GeneratorContext* generator_context,
string* error) const override;
uint64 GetSupportedFeatures() const override;
};
} // namespace csharp