forked from UbiquityDotNET/Llvm.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTemplateCodeGenerator.cs
More file actions
49 lines (41 loc) · 1.6 KB
/
Copy pathTemplateCodeGenerator.cs
File metadata and controls
49 lines (41 loc) · 1.6 KB
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
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
// Licensed under the Apache-2.0 WITH LLVM-exception license. See the LICENSE.md file in the project root for full license information.
namespace LlvmBindingsGenerator
{
/// <summary>Adapter class from a <see cref="ICodeGenTemplate"/> generator to a CppSharp ICodeGenerator</summary>
internal class TemplateCodeGenerator
: ICodeGenerator
{
public TemplateCodeGenerator(string absoluteFilePath, ICodeGenTemplate template)
{
IsValid = true;
FileAbsolutePath = absoluteFilePath;
Template = template;
}
public TemplateCodeGenerator(
string fileNameWithoutExtension,
string fileRelativeDirectory,
ICodeGenTemplate template
)
: this( isValid: true, fileNameWithoutExtension, fileRelativeDirectory, template )
{
}
public TemplateCodeGenerator(
bool isValid,
string fileNameWithoutExtension,
string fileRelativeDirectory,
ICodeGenTemplate template
)
{
IsValid = isValid;
FileNameWithoutExtension = fileNameWithoutExtension;
FileRelativeDirectory = fileRelativeDirectory;
Template = template;
}
public bool IsValid { get; }
public string? FileNameWithoutExtension { get; } = null;
public string? FileRelativeDirectory { get; } = null;
public string? FileAbsolutePath { get; } = null;
public ICodeGenTemplate Template { get; }
}
}