|
|
@ -53,24 +53,14 @@ namespace CppSharp.AST |
|
|
|
|
|
|
|
|
|
|
|
public virtual GenerationKind GenerationKind |
|
|
|
public virtual GenerationKind GenerationKind |
|
|
|
{ |
|
|
|
{ |
|
|
|
get |
|
|
|
get => generationKind ?? GenerationKind.Generate; |
|
|
|
{ |
|
|
|
set => generationKind = value; |
|
|
|
if (generationKind.HasValue) |
|
|
|
|
|
|
|
return generationKind.Value; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return GenerationKind.Generate; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
generationKind = value; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Whether the declaration should be generated.
|
|
|
|
/// Whether the declaration should be generated.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public virtual bool IsGenerated => GenerationKind == GenerationKind.Generate; |
|
|
|
public bool IsGenerated => GenerationKind == GenerationKind.Generate; |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Whether the declaration has an explicit set generation kind.
|
|
|
|
/// Whether the declaration has an explicit set generation kind.
|
|
|
@ -81,8 +71,7 @@ namespace CppSharp.AST |
|
|
|
/// Whether the declaration was explicitly set to be generated via
|
|
|
|
/// Whether the declaration was explicitly set to be generated via
|
|
|
|
/// the GenerationKind property as opposed to the default generated state.
|
|
|
|
/// the GenerationKind property as opposed to the default generated state.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public virtual bool IsExplicitlyGenerated => |
|
|
|
public bool IsExplicitlyGenerated => generationKind == GenerationKind.Generate; |
|
|
|
generationKind.HasValue && generationKind.Value == GenerationKind.Generate; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Whether the declaration internal bindings should be generated.
|
|
|
|
/// Whether the declaration internal bindings should be generated.
|
|
|
@ -92,9 +81,8 @@ namespace CppSharp.AST |
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Whether a binded version of this declaration is available.
|
|
|
|
/// Whether a binded version of this declaration is available.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public bool IsDeclared => |
|
|
|
public bool IsDeclared => GenerationKind == GenerationKind.Generate |
|
|
|
GenerationKind == GenerationKind.Generate |
|
|
|
|| GenerationKind == GenerationKind.Internal; |
|
|
|
|| GenerationKind == GenerationKind.Internal; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void ExplicitlyIgnore() |
|
|
|
public void ExplicitlyIgnore() |
|
|
|
{ |
|
|
|
{ |
|
|
@ -104,13 +92,13 @@ namespace CppSharp.AST |
|
|
|
[Obsolete("Replace set by ExplicitlyIgnore(). Replace get by GenerationKind == GenerationKind.None.")] |
|
|
|
[Obsolete("Replace set by ExplicitlyIgnore(). Replace get by GenerationKind == GenerationKind.None.")] |
|
|
|
public bool ExplicityIgnored |
|
|
|
public bool ExplicityIgnored |
|
|
|
{ |
|
|
|
{ |
|
|
|
get { return GenerationKind == GenerationKind.None; } |
|
|
|
get => GenerationKind == GenerationKind.None; |
|
|
|
set { if (value) ExplicitlyIgnore(); } |
|
|
|
set { if (value) ExplicitlyIgnore(); } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public virtual bool Ignore |
|
|
|
public virtual bool Ignore |
|
|
|
{ |
|
|
|
{ |
|
|
|
get { return GenerationKind == GenerationKind.None; } |
|
|
|
get => GenerationKind == GenerationKind.None; |
|
|
|
set { if (value) ExplicitlyIgnore(); } |
|
|
|
set { if (value) ExplicitlyIgnore(); } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -135,12 +123,11 @@ namespace CppSharp.AST |
|
|
|
// Namespace the declaration is contained in.
|
|
|
|
// Namespace the declaration is contained in.
|
|
|
|
public DeclarationContext Namespace |
|
|
|
public DeclarationContext Namespace |
|
|
|
{ |
|
|
|
{ |
|
|
|
get { return @namespace; } |
|
|
|
get => @namespace; |
|
|
|
set |
|
|
|
set |
|
|
|
{ |
|
|
|
{ |
|
|
|
@namespace = value; |
|
|
|
@namespace = value; |
|
|
|
if (OriginalNamespace == null) |
|
|
|
OriginalNamespace ??= @namespace; |
|
|
|
OriginalNamespace = @namespace; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -177,12 +164,11 @@ namespace CppSharp.AST |
|
|
|
|
|
|
|
|
|
|
|
public virtual string Name |
|
|
|
public virtual string Name |
|
|
|
{ |
|
|
|
{ |
|
|
|
get { return name; } |
|
|
|
get => name; |
|
|
|
set |
|
|
|
set |
|
|
|
{ |
|
|
|
{ |
|
|
|
name = value; |
|
|
|
name = value; |
|
|
|
if (OriginalName == null) |
|
|
|
OriginalName ??= name; |
|
|
|
OriginalName = name; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -192,19 +178,13 @@ namespace CppSharp.AST |
|
|
|
/// the real and the "effective" name of the declaration to properly
|
|
|
|
/// the real and the "effective" name of the declaration to properly
|
|
|
|
/// support things like inline namespaces when handling type maps.
|
|
|
|
/// support things like inline namespaces when handling type maps.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public virtual string LogicalName |
|
|
|
public virtual string LogicalName => Name; |
|
|
|
{ |
|
|
|
|
|
|
|
get { return Name; } |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// The effective original name of a declaration is the logical
|
|
|
|
/// The effective original name of a declaration is the logical
|
|
|
|
/// original name for the declaration.
|
|
|
|
/// original name for the declaration.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public virtual string LogicalOriginalName |
|
|
|
public virtual string LogicalOriginalName => OriginalName; |
|
|
|
{ |
|
|
|
|
|
|
|
get { return OriginalName; } |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static string QualifiedNameSeparator = "::"; |
|
|
|
public static string QualifiedNameSeparator = "::"; |
|
|
|
|
|
|
|
|
|
|
@ -233,8 +213,7 @@ namespace CppSharp.AST |
|
|
|
var currentNamespace = @namespace; |
|
|
|
var currentNamespace = @namespace; |
|
|
|
while (currentNamespace != null) |
|
|
|
while (currentNamespace != null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var isInlineNamespace = currentNamespace is Namespace && |
|
|
|
var isInlineNamespace = currentNamespace is Namespace {IsInline: true}; |
|
|
|
((Namespace) currentNamespace).IsInline; |
|
|
|
|
|
|
|
if (!isInlineNamespace) |
|
|
|
if (!isInlineNamespace) |
|
|
|
namespaces.Push(currentNamespace); |
|
|
|
namespaces.Push(currentNamespace); |
|
|
|
currentNamespace = currentNamespace.Namespace; |
|
|
|
currentNamespace = currentNamespace.Namespace; |
|
|
@ -280,8 +259,7 @@ namespace CppSharp.AST |
|
|
|
|
|
|
|
|
|
|
|
private static string GetDeclName(Declaration decl, string name) |
|
|
|
private static string GetDeclName(Declaration decl, string name) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var specialization = decl as ClassTemplateSpecialization; |
|
|
|
if (decl is ClassTemplateSpecialization specialization) |
|
|
|
if (specialization != null) |
|
|
|
|
|
|
|
return string.Format("{0}<{1}>", name, |
|
|
|
return string.Format("{0}<{1}>", name, |
|
|
|
string.Join(", ", specialization.Arguments.Select( |
|
|
|
string.Join(", ", specialization.Arguments.Select( |
|
|
|
a => a.Type.Type == null ? string.Empty : a.Type.ToString()))); |
|
|
|
a => a.Type.Type == null ? string.Empty : a.Type.ToString()))); |
|
|
|