From 914f4db513477d9aff726546bac47545195a3e37 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 16 Nov 2017 13:38:56 +0200 Subject: Rename "Visual Studio" to "Visual_Studio" Rename "External Repositories" to "External_Repositories". --- .../Tango.Protobuf/Compilers/CCompiler.cs | 41 ++++++++++++++++++++++ .../Tango.Protobuf/Compilers/CSharpCompiler.cs | 29 +++++++++++++++ .../Tango.Protobuf/Compilers/CppCompiler.cs | 34 ++++++++++++++++++ .../Tango.Protobuf/Compilers/JavaCompiler.cs | 37 +++++++++++++++++++ .../Tango.Protobuf/Compilers/PythonCompiler.cs | 29 +++++++++++++++ 5 files changed, 170 insertions(+) create mode 100644 Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs create mode 100644 Software/Visual_Studio/Tango.Protobuf/Compilers/CSharpCompiler.cs create mode 100644 Software/Visual_Studio/Tango.Protobuf/Compilers/CppCompiler.cs create mode 100644 Software/Visual_Studio/Tango.Protobuf/Compilers/JavaCompiler.cs create mode 100644 Software/Visual_Studio/Tango.Protobuf/Compilers/PythonCompiler.cs (limited to 'Software/Visual_Studio/Tango.Protobuf/Compilers') diff --git a/Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs b/Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs new file mode 100644 index 000000000..18aab84c6 --- /dev/null +++ b/Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Protobuf.Compilers +{ + /// + /// Represents a protobuf C Compiler. + /// + /// + public class CCompiler : ProtoCompiler + { + /// + /// Gets the compiler language. + /// + public override CompilerLanguage Language => CompilerLanguage.C; + + /// + /// Gets the protobuf compiler CLI arguments (without input/output files!). + /// + /// + protected override string GetProtoArguments() + { + return "--c_out"; + } + + /// + /// Gets the protobuf compiler CLI file name (override when using a compiler other than the default 'protoc.exe'). + /// + /// + /// + /// The compiler program must be located in the compilers folder. + /// + protected override string GetProtoCompilerName() + { + return "protoc-c"; + } + } +} diff --git a/Software/Visual_Studio/Tango.Protobuf/Compilers/CSharpCompiler.cs b/Software/Visual_Studio/Tango.Protobuf/Compilers/CSharpCompiler.cs new file mode 100644 index 000000000..682dda60c --- /dev/null +++ b/Software/Visual_Studio/Tango.Protobuf/Compilers/CSharpCompiler.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Protobuf.Compilers +{ + /// + /// Represents a protobuf C# Compiler. + /// + /// + public class CSharpCompiler : ProtoCompiler + { + /// + /// Gets the compiler language. + /// + public override CompilerLanguage Language => CompilerLanguage.CSharp; + + /// + /// Gets the protobuf compiler CLI arguments (without input/output files!). + /// + /// + protected override string GetProtoArguments() + { + return "--csharp_out"; + } + } +} diff --git a/Software/Visual_Studio/Tango.Protobuf/Compilers/CppCompiler.cs b/Software/Visual_Studio/Tango.Protobuf/Compilers/CppCompiler.cs new file mode 100644 index 000000000..e8ea998d5 --- /dev/null +++ b/Software/Visual_Studio/Tango.Protobuf/Compilers/CppCompiler.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Protobuf.Compilers +{ + /// + /// Represents a protobuf C# Compiler. + /// + /// + public class CppCompiler : ProtoCompiler + { + /// + /// Gets the compiler language. + /// + public override CompilerLanguage Language => CompilerLanguage.CPP; + + /// + /// Gets the protobuf compiler CLI arguments (without input/output files!). + /// + /// + protected override string GetProtoArguments() + { + return "--cpp_out"; + } + + /// + /// Gets a value indicating whether this compiler uses the default folder structure when generating code. + /// + public override bool UsesDefaultStructure => true; + } +} diff --git a/Software/Visual_Studio/Tango.Protobuf/Compilers/JavaCompiler.cs b/Software/Visual_Studio/Tango.Protobuf/Compilers/JavaCompiler.cs new file mode 100644 index 000000000..55f0cf77f --- /dev/null +++ b/Software/Visual_Studio/Tango.Protobuf/Compilers/JavaCompiler.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Helpers; +using Tango.Logging; + +namespace Tango.Protobuf.Compilers +{ + /// + /// Represents a protobuf Java Compiler. + /// + /// + public class JavaCompiler : ProtoCompiler + { + /// + /// Gets the compiler language. + /// + public override CompilerLanguage Language => CompilerLanguage.Java; + + /// + /// Gets the protobuf compiler CLI arguments (without input/output files!). + /// + /// + protected override string GetProtoArguments() + { + return "--java_out"; + } + + /// + /// Gets a value indicating whether this compiler uses the default folder structure when generating code. + /// + public override bool UsesDefaultStructure => true; + } +} diff --git a/Software/Visual_Studio/Tango.Protobuf/Compilers/PythonCompiler.cs b/Software/Visual_Studio/Tango.Protobuf/Compilers/PythonCompiler.cs new file mode 100644 index 000000000..e3c3ebbd7 --- /dev/null +++ b/Software/Visual_Studio/Tango.Protobuf/Compilers/PythonCompiler.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Protobuf.Compilers +{ + /// + /// Represents a protobuf Python Compiler. + /// + /// + public class PythonCompiler : ProtoCompiler + { + /// + /// Gets the compiler language. + /// + public override CompilerLanguage Language => CompilerLanguage.Python; + + /// + /// Gets the protobuf compiler CLI arguments (without input/output files!). + /// + /// + protected override string GetProtoArguments() + { + return "--python_out"; + } + } +} -- cgit v1.3.1