aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Protobuf/IProtoCompiler.cs
blob: 15d65b767d17f6e22c870fd6b05f7c49b4f9c371 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.Protobuf
{
    /// <summary>
    /// Represents a protobuf messages compiler.
    /// </summary>
    public interface IProtoCompiler : IDisposable
    {
        /// <summary>
        /// Occurs when the compiler has made some progress.
        /// </summary>
        event EventHandler<CompilerProgressEventArgs> CompilationProgress;

        /// <summary>
        /// Compiles the specified .proto message file. 
        /// </summary>
        /// <param name="inputFile">.proto file to compile</param>
        /// <returns>A list of compiled results.</returns>
        IEnumerable<CompilerFileResult> CompileFile(String inputFile);

        /// <summary>
        /// Compiles the specified .proto message file asynchronously. 
        /// </summary>
        /// <param name="inputFile">.proto file to compile</param>
        /// <returns>A list of compiled results.</returns>
        Task<IEnumerable<CompilerFileResult>> CompileFileAsync(String inputFile);

        /// <summary>
        /// Compiles all files in the specified folder recursively. 
        /// </summary>
        /// <param name="sourceFolder">The source folder</param>
        /// <returns>Compilation result.</returns>
        CompilerFolderResult CompileFolder(String sourceFolder, params String[] includeFolders);

        /// <summary>
        /// Compiles all files in the specified folder recursively and asynchronously. 
        /// </summary>
        /// <param name="sourceFolder">The source folder</param>
        /// <returns>Compilation result.</returns>
        Task<CompilerFolderResult> CompileFolderAsync(String sourceFolder);

        /// <summary>
        /// Gets the compiler language.
        /// </summary>
        CompilerLanguage Language { get; }

        /// <summary>
        /// Gets the proto imports folders.
        /// </summary>
        List<String> ImportsFolders { get; }

        /// <summary>
        /// Gets a value indicating whether this compiler uses the default folder structure when generating code.
        /// </summary>
        bool UsesDefaultStructure { get; }
    }
}