diff --git a/.editorconfig b/.editorconfig
index 3467ebf9..1909f880 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -21,6 +21,9 @@ end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
+spelling_error_severity = information
+spelling_exclusion_path = exclusion.dic
+spelling_languages = en-us
tab_width = 4
trim_trailing_whitespace = true
diff --git a/ClangSharp.sln b/ClangSharp.sln
index 1516287e..22b11833 100644
--- a/ClangSharp.sln
+++ b/ClangSharp.sln
@@ -14,6 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Directory.Packages.props = Directory.Packages.props
+ exclusion.dic = exclusion.dic
global.json = global.json
LICENSE.md = LICENSE.md
NOTICE.md = NOTICE.md
diff --git a/Directory.Build.props b/Directory.Build.props
index b8e691a8..91d6fd50 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -20,7 +20,7 @@
true
- preview
+ preview-all
$(BaseArtifactsPath)obj/$(BaseArtifactsPathSuffix)/
embedded
false
@@ -42,10 +42,15 @@
$(BaseArtifactsPath)bin/$(BaseArtifactsPathSuffix)/
.NET Foundation
true
+ true
+ true
+ true
+ true
$(BaseArtifactsPath)pkg/$(Configuration)/
+ 16.0.0
ClangSharp
ClangSharp
- 16.0.0
+ 16.0.1
rc1
pr
diff --git a/Directory.Build.targets b/Directory.Build.targets
index ee04b707..c0804224 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -12,7 +12,7 @@
- $(NoWarn);AD0001
+ $(NoWarn)
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 44502178..70b0337b 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -16,7 +16,6 @@
-
diff --git a/exclusion.dic b/exclusion.dic
new file mode 100644
index 00000000..b9f77547
--- /dev/null
+++ b/exclusion.dic
@@ -0,0 +1,223 @@
+accum
+addr
+addrspace
+alignm
+alignof
+arglist
+argv
+assoc
+assocs
+attrs
+autorelease
+autoreleased
+bicc
+bitwidth
+blittability
+builtin
+bycopy
+byref
+callconv
+cdecl
+clangsharp
+cmse
+coawait
+comdat
+constexpr
+convs
+coreturn
+coyield
+cref
+cset
+csharp
+ctors
+cxxmd
+cx_attrkind_a
+cx_attrkind_amdgpu
+cx_attrkind_arm
+cx_attrkind_avr
+cx_attrkind_bpf
+cx_attrkind_btf
+cx_attrkind_c
+cx_attrkind_cf
+cx_attrkind_cfi
+cx_attrkind_cmsens
+cx_attrkind_cpu
+cx_attrkind_cuda
+cx_attrkind_dll
+cx_attrkind_enforcetcb
+cx_attrkind_firsthlsl
+cx_attrkind_firstparameterabi
+cx_attrkind_gnu
+cx_attrkind_hip
+cx_attrkind_hlsl
+cx_attrkind_i
+cx_attrkind_ib
+cx_attrkind_lasthlsl
+cx_attrkind_lastparameterabi
+cx_attrkind_lto
+cx_attrkind_mig
+cx_attrkind_ms
+cx_attrkind_msabi
+cx_attrkind_ns
+cx_attrkind_objc
+cx_attrkind_objcgc
+cx_attrkind_objcns
+cx_attrkind_omp
+cx_attrkind_opencl
+cx_attrkind_os
+cx_attrkind_pragmaclangbss
+cx_attrkind_riscv
+cx_attrkind_s
+cx_attrkind_swiftobjc
+cx_attrkind_sycl
+cx_attrkind_sysvabi
+cx_attrkind_tls
+cx_attrkind_trivialabi
+cx_attrkind_u
+cx_attrkind_x
+cx_ck_blockpointertoobjc
+cx_ck_inttoocl
+cx_ck_objc
+cx_ck_zerotoocl
+cx_cr_objc
+cx_declkind_cxx
+cx_declkind_externc
+cx_declkind_firstcxx
+cx_declkind_firstobjc
+cx_declkind_hlsl
+cx_declkind_lastcxx
+cx_declkind_lastobjc
+cx_declkind_ms
+cx_declkind_objc
+cx_declkind_omp
+cx_sc_opencl
+cx_stmtclass_c
+cx_stmtclass_cuda
+cx_stmtclass_cxx
+cx_stmtclass_firstcxx
+cx_stmtclass_firstomp
+cx_stmtclass_gcc
+cx_stmtclass_gnu
+cx_stmtclass_lastcxx
+cx_stmtclass_lastomp
+cx_stmtclass_ms
+cx_stmtclass_objc
+cx_stmtclass_omp
+cx_stmtclass_seh
+cx_stmtclass_sycl
+cx_stmtclass_va
+cx_typeclass_btf
+cx_typeclass_l
+cx_typeclass_objc
+cx_typeclass_r
+cx_uett_openmp
+decls
+declspec
+decltype
+defs
+depobj
+descs
+diag
+diags
+disp
+dont
+dtor
+edouble
+ehalf
+entrypoint
+enums
+equad
+equatable
+esingle
+exprs
+fastcall
+fnptr
+funcs
+gnuxx
+imag
+impl
+impls
+inits
+inlined
+inlining
+inout
+intptr
+ivars
+libclang
+librarypath
+llvm
+locs
+manglings
+memberwise
+membuffer
+memcpy
+memset
+mips
+nand
+noattr
+noexcept
+nothrow
+nrvo
+nullptr
+nunit
+objc
+oneway
+opencl
+parens
+parm
+pinvoke
+pointee
+ptrdiff
+readwrite
+redecl
+redeclarable
+relro
+remappings
+rodata
+setlasterror
+setslastsystemerror
+simd
+stackalloc
+stdcall
+stmt
+stmts
+streamin
+streamout
+stringify
+subminor
+subst
+suppressgctransition
+taskgroup
+taskwait
+taskyield
+thiscall
+thunks
+trylock
+typeid
+typename
+typestate
+uintptr
+undeduced
+unix
+unmarshal
+unscoped
+usings
+usr_objc
+uuid
+uuidof
+uuids
+uwtable
+varargs
+vbase
+vbases
+vtbl
+vtblindex
+vtbls
+vtor
+wcslen
+weakref
+winapi
+wsgct
+wsle
+xdata
+xunit
diff --git a/global.json b/global.json
index 39280da2..d8833ada 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
{
"sdk": {
- "version": "7.0.100",
+ "version": "8.0.100-preview",
"allowPrerelease": true,
"rollForward": "latestFeature"
}
diff --git a/scripts/build.ps1 b/scripts/build.ps1
index 61197fd6..5558ed50 100644
--- a/scripts/build.ps1
+++ b/scripts/build.ps1
@@ -172,8 +172,7 @@ try {
$DotNetInstallDirectory = Join-Path -Path $ArtifactsDir -ChildPath "dotnet"
Create-Directory -Path $DotNetInstallDirectory
- & $DotNetInstallScript -Channel 6.0 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture
- & $DotNetInstallScript -Channel 7.0 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture
+ & $DotNetInstallScript -Channel 8.0 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture
$env:PATH="$DotNetInstallDirectory;$env:PATH"
}
diff --git a/scripts/build.sh b/scripts/build.sh
index a7fbb8a7..c435695f 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -204,8 +204,7 @@ if [[ ! -z "$architecture" ]]; then
DotNetInstallDirectory="$ArtifactsDir/dotnet"
CreateDirectory "$DotNetInstallDirectory"
- . "$DotNetInstallScript" --channel 6.0 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture"
- . "$DotNetInstallScript" --channel 7.0 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture"
+ . "$DotNetInstallScript" --channel 8.0 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture"
PATH="$DotNetInstallDirectory:$PATH:"
fi
diff --git a/sources/ClangSharp.Interop/ClangSharp.Interop.csproj b/sources/ClangSharp.Interop/ClangSharp.Interop.csproj
index 75455540..70d1f97a 100644
--- a/sources/ClangSharp.Interop/ClangSharp.Interop.csproj
+++ b/sources/ClangSharp.Interop/ClangSharp.Interop.csproj
@@ -2,11 +2,12 @@
- net6.0;net7.0;netstandard2.0
+ $(NoWarn);CA1069
+ net8.0;netstandard2.0
-
+
diff --git a/sources/ClangSharp.Interop/CompatibilitySuppressions.xml b/sources/ClangSharp.Interop/CompatibilitySuppressions.xml
new file mode 100644
index 00000000..3d1754f1
--- /dev/null
+++ b/sources/ClangSharp.Interop/CompatibilitySuppressions.xml
@@ -0,0 +1,58 @@
+
+
+
+ CP0002
+ M:ClangSharp.Interop.clang.add_ResolveLibrary(System.Runtime.InteropServices.DllImportResolver)
+ lib/net6.0/ClangSharp.Interop.dll
+ lib/netstandard2.0/ClangSharp.Interop.dll
+ true
+
+
+ CP0002
+ M:ClangSharp.Interop.clang.remove_ResolveLibrary(System.Runtime.InteropServices.DllImportResolver)
+ lib/net6.0/ClangSharp.Interop.dll
+ lib/netstandard2.0/ClangSharp.Interop.dll
+ true
+
+
+ CP0002
+ M:ClangSharp.Interop.CXCodeCompleteResults.GetContaininerKind(System.Boolean@)
+ lib/net6.0/ClangSharp.Interop.dll
+ lib/netstandard2.0/ClangSharp.Interop.dll
+ true
+
+
+ CP0002
+ M:ClangSharp.Interop.clang.add_ResolveLibrary(System.Runtime.InteropServices.DllImportResolver)
+ lib/net7.0/ClangSharp.Interop.dll
+ lib/netstandard2.0/ClangSharp.Interop.dll
+ true
+
+
+ CP0002
+ M:ClangSharp.Interop.clang.remove_ResolveLibrary(System.Runtime.InteropServices.DllImportResolver)
+ lib/net7.0/ClangSharp.Interop.dll
+ lib/netstandard2.0/ClangSharp.Interop.dll
+ true
+
+
+ CP0002
+ M:ClangSharp.Interop.CXCodeCompleteResults.GetContaininerKind(System.Boolean@)
+ lib/net7.0/ClangSharp.Interop.dll
+ lib/netstandard2.0/ClangSharp.Interop.dll
+ true
+
+
+ CP0002
+ M:ClangSharp.Interop.CXCodeCompleteResults.GetContaininerKind(out bool)
+ lib/netstandard2.0/ClangSharp.Interop.dll
+ lib/netstandard2.0/ClangSharp.Interop.dll
+
+
+ CP0002
+ M:ClangSharp.Interop.CXCodeCompleteResults.GetContaininerKind(System.Boolean@)
+ lib/netstandard2.0/ClangSharp.Interop.dll
+ lib/netstandard2.0/ClangSharp.Interop.dll
+ true
+
+
diff --git a/sources/ClangSharp.Interop/Configuration.cs b/sources/ClangSharp.Interop/Configuration.cs
new file mode 100644
index 00000000..a7ba5829
--- /dev/null
+++ b/sources/ClangSharp.Interop/Configuration.cs
@@ -0,0 +1,30 @@
+// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
+
+using System;
+
+namespace ClangSharp.Interop;
+
+internal static class Configuration
+{
+ private static readonly bool s_disableResolveLibraryHook = GetAppContextData("ClangSharp.Interop.DisableResolveLibraryHook", defaultValue: false);
+
+ public static bool DisableResolveLibraryHook => s_disableResolveLibraryHook;
+
+ private static bool GetAppContextData(string name, bool defaultValue)
+ {
+ object? data = AppContext.GetData(name);
+
+ if (data is bool value)
+ {
+ return value;
+ }
+ else if ((data is string s) && bool.TryParse(s, out bool result))
+ {
+ return result;
+ }
+ else
+ {
+ return defaultValue;
+ }
+ }
+}
\ No newline at end of file
diff --git a/sources/ClangSharp.Interop/Extensions/CXClientData.cs b/sources/ClangSharp.Interop/Extensions/CXClientData.cs
index f26edc2d..e044d9cf 100644
--- a/sources/ClangSharp.Interop/Extensions/CXClientData.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXClientData.cs
@@ -21,9 +21,9 @@ public CXClientData(IntPtr handle)
public static bool operator !=(CXClientData left, CXClientData right) => left.Handle != right.Handle;
- public override bool Equals(object? obj) => (obj is CXClientData other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXClientData other) && Equals(other);
- public bool Equals(CXClientData other) => this == other;
+ public readonly bool Equals(CXClientData other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXCodeCompleteResults.cs b/sources/ClangSharp.Interop/Extensions/CXCodeCompleteResults.cs
index fdeb5de2..33713a49 100644
--- a/sources/ClangSharp.Interop/Extensions/CXCodeCompleteResults.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXCodeCompleteResults.cs
@@ -60,7 +60,7 @@ public void Dispose()
}
}
- public CXCursorKind GetContaininerKind(out bool isIncomplete)
+ public CXCursorKind GetContainerKind(out bool isIncomplete)
{
fixed (CXCodeCompleteResults* pThis = &this)
{
@@ -97,5 +97,5 @@ public uint GetNumFixIts(uint completionIndex)
}
}
- public void Sort() => clang.sortCodeCompletionResults(Results, NumResults);
+ public readonly void Sort() => clang.sortCodeCompletionResults(Results, NumResults);
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXComment.cs b/sources/ClangSharp.Interop/Extensions/CXComment.cs
index 12a4e86a..26f03220 100644
--- a/sources/ClangSharp.Interop/Extensions/CXComment.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXComment.cs
@@ -4,69 +4,69 @@ namespace ClangSharp.Interop;
public partial struct CXComment
{
- public CXString BlockCommandComment_CommandName => clang.BlockCommandComment_getCommandName(this);
+ public readonly CXString BlockCommandComment_CommandName => clang.BlockCommandComment_getCommandName(this);
- public uint BlockCommandComment_NumArgs => clang.BlockCommandComment_getNumArgs(this);
+ public readonly uint BlockCommandComment_NumArgs => clang.BlockCommandComment_getNumArgs(this);
- public CXComment BlockCommandComment_Paragraph => clang.BlockCommandComment_getParagraph(this);
+ public readonly CXComment BlockCommandComment_Paragraph => clang.BlockCommandComment_getParagraph(this);
- public CXString FullComment_AsHtml => clang.FullComment_getAsHTML(this);
+ public readonly CXString FullComment_AsHtml => clang.FullComment_getAsHTML(this);
- public CXString FullComment_AsXml => clang.FullComment_getAsXML(this);
+ public readonly CXString FullComment_AsXml => clang.FullComment_getAsXML(this);
- public uint HtmlStartTag_NumAttrs => clang.HTMLStartTag_getNumAttrs(this);
+ public readonly uint HtmlStartTag_NumAttrs => clang.HTMLStartTag_getNumAttrs(this);
- public bool HtmlStartTagComment_IsSelfClosing => clang.HTMLStartTagComment_isSelfClosing(this) != 0;
+ public readonly bool HtmlStartTagComment_IsSelfClosing => clang.HTMLStartTagComment_isSelfClosing(this) != 0;
- public CXString HtmlTagComment_AsString => clang.HTMLTagComment_getAsString(this);
+ public readonly CXString HtmlTagComment_AsString => clang.HTMLTagComment_getAsString(this);
- public CXString HtmlTagComment_TagName => clang.HTMLTagComment_getTagName(this);
+ public readonly CXString HtmlTagComment_TagName => clang.HTMLTagComment_getTagName(this);
- public CXString InlineCommandComment_CommandName => clang.InlineCommandComment_getCommandName(this);
+ public readonly CXString InlineCommandComment_CommandName => clang.InlineCommandComment_getCommandName(this);
- public uint InlineCommandComment_NumArgs => clang.InlineCommandComment_getNumArgs(this);
+ public readonly uint InlineCommandComment_NumArgs => clang.InlineCommandComment_getNumArgs(this);
- public CXCommentInlineCommandRenderKind InlineCommandComment_RenderKind => clang.InlineCommandComment_getRenderKind(this);
+ public readonly CXCommentInlineCommandRenderKind InlineCommandComment_RenderKind => clang.InlineCommandComment_getRenderKind(this);
- public bool InlineContentComment_HasTrailingNewline => clang.InlineContentComment_hasTrailingNewline(this) != 0;
+ public readonly bool InlineContentComment_HasTrailingNewline => clang.InlineContentComment_hasTrailingNewline(this) != 0;
- public bool IsWhitespace => clang.Comment_isWhitespace(this) != 0;
+ public readonly bool IsWhitespace => clang.Comment_isWhitespace(this) != 0;
- public CXCommentKind Kind => clang.Comment_getKind(this);
+ public readonly CXCommentKind Kind => clang.Comment_getKind(this);
- public uint NumChildren => clang.Comment_getNumChildren(this);
+ public readonly uint NumChildren => clang.Comment_getNumChildren(this);
- public CXCommentParamPassDirection ParamCommandComment_Direction => clang.ParamCommandComment_getDirection(this);
+ public readonly CXCommentParamPassDirection ParamCommandComment_Direction => clang.ParamCommandComment_getDirection(this);
- public bool ParamCommandComment_IsDirectionExplicit => clang.ParamCommandComment_isDirectionExplicit(this) != 0;
+ public readonly bool ParamCommandComment_IsDirectionExplicit => clang.ParamCommandComment_isDirectionExplicit(this) != 0;
- public bool ParamCommandComment_IsParamIndexValid => clang.ParamCommandComment_isParamIndexValid(this) != 0;
+ public readonly bool ParamCommandComment_IsParamIndexValid => clang.ParamCommandComment_isParamIndexValid(this) != 0;
- public uint ParamCommandComment_ParamIndex => clang.ParamCommandComment_getParamIndex(this);
+ public readonly uint ParamCommandComment_ParamIndex => clang.ParamCommandComment_getParamIndex(this);
- public CXString ParamCommandComment_ParamName => clang.ParamCommandComment_getParamName(this);
+ public readonly CXString ParamCommandComment_ParamName => clang.ParamCommandComment_getParamName(this);
- public CXString TextComment_Text => clang.TextComment_getText(this);
+ public readonly CXString TextComment_Text => clang.TextComment_getText(this);
- public uint TParamCommandComment_Depth => clang.TParamCommandComment_getDepth(this);
+ public readonly uint TParamCommandComment_Depth => clang.TParamCommandComment_getDepth(this);
- public CXString TParamCommandComment_ParamName => clang.TParamCommandComment_getParamName(this);
+ public readonly CXString TParamCommandComment_ParamName => clang.TParamCommandComment_getParamName(this);
- public bool TParamCommandComment_IsParamPositionValid => clang.TParamCommandComment_isParamPositionValid(this) != 0;
+ public readonly bool TParamCommandComment_IsParamPositionValid => clang.TParamCommandComment_isParamPositionValid(this) != 0;
- public CXString VerbatimBlockLineComment_Text => clang.VerbatimBlockLineComment_getText(this);
+ public readonly CXString VerbatimBlockLineComment_Text => clang.VerbatimBlockLineComment_getText(this);
- public CXString VerbatimLineComment_Text => clang.VerbatimLineComment_getText(this);
+ public readonly CXString VerbatimLineComment_Text => clang.VerbatimLineComment_getText(this);
- public CXString BlockCommandComment_GetArgText(uint index) => clang.BlockCommandComment_getArgText(this, index);
+ public readonly CXString BlockCommandComment_GetArgText(uint index) => clang.BlockCommandComment_getArgText(this, index);
- public CXComment GetChild(uint index) => clang.Comment_getChild(this, index);
+ public readonly CXComment GetChild(uint index) => clang.Comment_getChild(this, index);
- public CXString HtmlStartTag_GetAttrName(uint index) => clang.HTMLStartTag_getAttrName(this, index);
+ public readonly CXString HtmlStartTag_GetAttrName(uint index) => clang.HTMLStartTag_getAttrName(this, index);
- public CXString HtmlStartTag_GetAttrValue(uint index) => clang.HTMLStartTag_getAttrValue(this, index);
+ public readonly CXString HtmlStartTag_GetAttrValue(uint index) => clang.HTMLStartTag_getAttrValue(this, index);
- public CXString InlineCommandComment_GetArgText(uint index) => clang.InlineCommandComment_getArgText(this, index);
+ public readonly CXString InlineCommandComment_GetArgText(uint index) => clang.InlineCommandComment_getArgText(this, index);
- public uint TParamCommandComment_GetIndex(uint depth) => clang.TParamCommandComment_getIndex(this, depth);
+ public readonly uint TParamCommandComment_GetIndex(uint depth) => clang.TParamCommandComment_getIndex(this, depth);
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXCompilationDatabase.cs b/sources/ClangSharp.Interop/Extensions/CXCompilationDatabase.cs
index f8f34eac..58cd8f36 100644
--- a/sources/ClangSharp.Interop/Extensions/CXCompilationDatabase.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXCompilationDatabase.cs
@@ -11,7 +11,7 @@ public CXCompilationDatabase(IntPtr handle)
Handle = handle;
}
- public CXCompileCommands AllCompileCommands => (CXCompileCommands)clang.CompilationDatabase_getAllCompileCommands(this);
+ public readonly CXCompileCommands AllCompileCommands => (CXCompileCommands)clang.CompilationDatabase_getAllCompileCommands(this);
public IntPtr Handle { get; set; }
@@ -42,15 +42,15 @@ public void Dispose()
}
}
- public override bool Equals(object? obj) => (obj is CXCompilationDatabase other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXCompilationDatabase other) && Equals(other);
- public bool Equals(CXCompilationDatabase other) => this == other;
+ public readonly bool Equals(CXCompilationDatabase other) => this == other;
- public CXCompileCommands GetCompileCommands(string completeFileName)
+ public readonly CXCompileCommands GetCompileCommands(string completeFileName)
{
using var marshaledCompleteFileName = new MarshaledString(completeFileName);
return (CXCompileCommands)clang.CompilationDatabase_getCompileCommands(this, marshaledCompleteFileName);
}
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXCompileCommand.cs b/sources/ClangSharp.Interop/Extensions/CXCompileCommand.cs
index 7b0d1601..f09932a0 100644
--- a/sources/ClangSharp.Interop/Extensions/CXCompileCommand.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXCompileCommand.cs
@@ -11,15 +11,15 @@ public CXCompileCommand(IntPtr handle)
Handle = handle;
}
- public CXString Directory => clang.CompileCommand_getDirectory(this);
+ public readonly CXString Directory => clang.CompileCommand_getDirectory(this);
- public CXString Filename => clang.CompileCommand_getFilename(this);
+ public readonly CXString Filename => clang.CompileCommand_getFilename(this);
public IntPtr Handle { get; set; }
- public uint NumArgs => clang.CompileCommand_getNumArgs(this);
+ public readonly uint NumArgs => clang.CompileCommand_getNumArgs(this);
- public uint NumMappedSources => clang.CompileCommand_getNumMappedSources(this);
+ public readonly uint NumMappedSources => clang.CompileCommand_getNumMappedSources(this);
public static explicit operator CXCompileCommand(void* value) => new CXCompileCommand((IntPtr)value);
@@ -29,15 +29,15 @@ public CXCompileCommand(IntPtr handle)
public static bool operator !=(CXCompileCommand left, CXCompileCommand right) => left.Handle != right.Handle;
- public override bool Equals(object? obj) => (obj is CXCompileCommand other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXCompileCommand other) && Equals(other);
- public bool Equals(CXCompileCommand other) => this == other;
+ public readonly bool Equals(CXCompileCommand other) => this == other;
- public CXString GetArg(uint index) => clang.CompileCommand_getArg(this, index);
+ public readonly CXString GetArg(uint index) => clang.CompileCommand_getArg(this, index);
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public CXString GetMappedSourceContent(uint index) => clang.CompileCommand_getMappedSourceContent(this, index);
+ public readonly CXString GetMappedSourceContent(uint index) => clang.CompileCommand_getMappedSourceContent(this, index);
- public CXString GetMappedSourcePath(uint index) => clang.CompileCommand_getMappedSourcePath(this, index);
+ public readonly CXString GetMappedSourcePath(uint index) => clang.CompileCommand_getMappedSourcePath(this, index);
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXCompileCommands.cs b/sources/ClangSharp.Interop/Extensions/CXCompileCommands.cs
index 7c79b242..14b1dbd7 100644
--- a/sources/ClangSharp.Interop/Extensions/CXCompileCommands.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXCompileCommands.cs
@@ -13,13 +13,13 @@ public CXCompileCommands(IntPtr handle)
Handle = handle;
}
- public CXCompileCommand this[uint index] => GetCommand(index);
+ public readonly CXCompileCommand this[uint index] => GetCommand(index);
- public int Count => (int)Size;
+ public readonly int Count => (int)Size;
public IntPtr Handle { get; set; }
- public uint Size => clang.CompileCommands_getSize(this);
+ public readonly uint Size => clang.CompileCommands_getSize(this);
public static explicit operator CXCompileCommands(void* value) => new CXCompileCommands((IntPtr)value);
@@ -38,13 +38,13 @@ public void Dispose()
}
}
- public override bool Equals(object? obj) => (obj is CXCompileCommands other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXCompileCommands other) && Equals(other);
- public bool Equals(CXCompileCommands other) => this == other;
+ public readonly bool Equals(CXCompileCommands other) => this == other;
- public CXCompileCommand GetCommand(uint index) => (CXCompileCommand)clang.CompileCommands_getCommand(this, index);
+ public readonly CXCompileCommand GetCommand(uint index) => (CXCompileCommand)clang.CompileCommands_getCommand(this, index);
- public IEnumerator GetEnumerator()
+ public readonly IEnumerator GetEnumerator()
{
var count = Size;
@@ -54,7 +54,7 @@ public IEnumerator GetEnumerator()
}
}
- IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
+ readonly IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXCompletionString.cs b/sources/ClangSharp.Interop/Extensions/CXCompletionString.cs
index 39aef731..908b96b8 100644
--- a/sources/ClangSharp.Interop/Extensions/CXCompletionString.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXCompletionString.cs
@@ -11,17 +11,17 @@ public CXCompletionString(IntPtr handle)
Handle = handle;
}
- public CXAvailabilityKind Availability => clang.getCompletionAvailability(this);
+ public readonly CXAvailabilityKind Availability => clang.getCompletionAvailability(this);
- public CXString BriefComment => clang.getCompletionBriefComment(this);
+ public readonly CXString BriefComment => clang.getCompletionBriefComment(this);
public IntPtr Handle { get; set; }
- public uint NumAnnotations => clang.getCompletionNumAnnotations(this);
+ public readonly uint NumAnnotations => clang.getCompletionNumAnnotations(this);
- public uint NumChunks => clang.getNumCompletionChunks(this);
+ public readonly uint NumChunks => clang.getNumCompletionChunks(this);
- public uint Priority => clang.getCompletionPriority(this);
+ public readonly uint Priority => clang.getCompletionPriority(this);
public static explicit operator CXCompletionString(void* value) => new CXCompletionString((IntPtr)value);
@@ -31,21 +31,21 @@ public CXCompletionString(IntPtr handle)
public static bool operator !=(CXCompletionString left, CXCompletionString right) => left.Handle != right.Handle;
- public override bool Equals(object? obj) => (obj is CXCompletionString other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXCompletionString other) && Equals(other);
- public bool Equals(CXCompletionString other) => this == other;
+ public readonly bool Equals(CXCompletionString other) => this == other;
- public CXString GetAnnotation(uint index) => clang.getCompletionAnnotation(this, index);
+ public readonly CXString GetAnnotation(uint index) => clang.getCompletionAnnotation(this, index);
- public CXCompletionString GetChunkCompletionString(uint index) => (CXCompletionString)clang.getCompletionChunkCompletionString(this, index);
+ public readonly CXCompletionString GetChunkCompletionString(uint index) => (CXCompletionString)clang.getCompletionChunkCompletionString(this, index);
- public CXCompletionChunkKind GetChunkKind(uint index) => clang.getCompletionChunkKind(this, index);
+ public readonly CXCompletionChunkKind GetChunkKind(uint index) => clang.getCompletionChunkKind(this, index);
- public CXString GetChunkText(uint index) => clang.getCompletionChunkText(this, index);
+ public readonly CXString GetChunkText(uint index) => clang.getCompletionChunkText(this, index);
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public CXString GetParent(out CXCursorKind kind)
+ public readonly CXString GetParent(out CXCursorKind kind)
{
fixed (CXCursorKind* pKind = &kind)
{
diff --git a/sources/ClangSharp.Interop/Extensions/CXCursor.cs b/sources/ClangSharp.Interop/Extensions/CXCursor.cs
index 35bf41b8..8febdfcc 100644
--- a/sources/ClangSharp.Interop/Extensions/CXCursor.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXCursor.cs
@@ -17,17 +17,17 @@ public unsafe partial struct CXCursor : IEquatable
{
public static CXCursor Null => clang.getNullCursor();
- public CXType ArgumentType => clangsharp.Cursor_getArgumentType(this);
+ public readonly CXType ArgumentType => clangsharp.Cursor_getArgumentType(this);
- public long ArraySize => clangsharp.Cursor_getArraySize(this);
+ public readonly long ArraySize => clangsharp.Cursor_getArraySize(this);
- public CXCursor AsFunction => clangsharp.Cursor_getAsFunction(this);
+ public readonly CXCursor AsFunction => clangsharp.Cursor_getAsFunction(this);
- public CX_AtomicOperatorKind AtomicOperatorKind => clangsharp.Cursor_getAtomicOpcode(this);
+ public readonly CX_AtomicOperatorKind AtomicOperatorKind => clangsharp.Cursor_getAtomicOpcode(this);
- public CX_AttrKind AttrKind => clangsharp.Cursor_getAttrKind(this);
+ public readonly CX_AttrKind AttrKind => clangsharp.Cursor_getAttrKind(this);
- public string AttrKindSpelling
+ public readonly string AttrKindSpelling
{
get
{
@@ -432,45 +432,45 @@ public string AttrKindSpelling
}
}
- public CXAvailabilityKind Availability => clang.getCursorAvailability(this);
+ public readonly CXAvailabilityKind Availability => clang.getCursorAvailability(this);
- public CX_BinaryOperatorKind BinaryOperatorKind => clangsharp.Cursor_getBinaryOpcode(this);
+ public readonly CX_BinaryOperatorKind BinaryOperatorKind => clangsharp.Cursor_getBinaryOpcode(this);
- public CXString BinaryOperatorKindSpelling => clangsharp.Cursor_getBinaryOpcodeSpelling(BinaryOperatorKind);
+ public readonly CXString BinaryOperatorKindSpelling => clangsharp.Cursor_getBinaryOpcodeSpelling(BinaryOperatorKind);
- public CXCursor BindingExpr => clangsharp.Cursor_getBindingExpr(this);
+ public readonly CXCursor BindingExpr => clangsharp.Cursor_getBindingExpr(this);
- public CXCursor BitWidth => clangsharp.Cursor_getBitWidth(this);
+ public readonly CXCursor BitWidth => clangsharp.Cursor_getBitWidth(this);
- public CXCursor BlockManglingContextDecl => clangsharp.Cursor_getBlockManglingContextDecl(this);
+ public readonly CXCursor BlockManglingContextDecl => clangsharp.Cursor_getBlockManglingContextDecl(this);
- public int BlockManglingNumber => clangsharp.Cursor_getBlockManglingNumber(this);
+ public readonly int BlockManglingNumber => clangsharp.Cursor_getBlockManglingNumber(this);
- public bool BlockMissingReturnType => clangsharp.Cursor_getBlockMissingReturnType(this) != 0;
+ public readonly bool BlockMissingReturnType => clangsharp.Cursor_getBlockMissingReturnType(this) != 0;
- public CXCursor Body => clangsharp.Cursor_getBody(this);
+ public readonly CXCursor Body => clangsharp.Cursor_getBody(this);
- public CXString BriefCommentText => clang.Cursor_getBriefCommentText(this);
+ public readonly CXString BriefCommentText => clang.Cursor_getBriefCommentText(this);
- public CXType CallResultType => clangsharp.Cursor_getCallResultType(this);
+ public readonly CXType CallResultType => clangsharp.Cursor_getCallResultType(this);
- public bool CanAvoidCopyToHeap => clangsharp.Cursor_getCanAvoidCopyToHeap(this) != 0;
+ public readonly bool CanAvoidCopyToHeap => clangsharp.Cursor_getCanAvoidCopyToHeap(this) != 0;
- public CXCursor CanonicalCursor => clangsharp.Cursor_getCanonical(this);
+ public readonly CXCursor CanonicalCursor => clangsharp.Cursor_getCanonical(this);
- public CXCursor CapturedDecl => clangsharp.Cursor_getCapturedDecl(this);
+ public readonly CXCursor CapturedDecl => clangsharp.Cursor_getCapturedDecl(this);
- public CXCursor CapturedRecordDecl => clangsharp.Cursor_getCapturedRecordDecl(this);
+ public readonly CXCursor CapturedRecordDecl => clangsharp.Cursor_getCapturedRecordDecl(this);
- public CX_CapturedRegionKind CapturedRegionKind => clangsharp.Cursor_getCapturedRegionKind(this);
+ public readonly CX_CapturedRegionKind CapturedRegionKind => clangsharp.Cursor_getCapturedRegionKind(this);
- public CXCursor CapturedStmt => clangsharp.Cursor_getCapturedStmt(this);
+ public readonly CXCursor CapturedStmt => clangsharp.Cursor_getCapturedStmt(this);
- public bool CapturesCXXThis => clangsharp.Cursor_getCapturesCXXThis(this) != 0;
+ public readonly bool CapturesCXXThis => clangsharp.Cursor_getCapturesCXXThis(this) != 0;
- public CX_CastKind CastKind => clangsharp.Cursor_getCastKind(this);
+ public readonly CX_CastKind CastKind => clangsharp.Cursor_getCastKind(this);
- public string CastKindSpelling
+ public readonly string CastKindSpelling
{
get
{
@@ -546,69 +546,69 @@ public string CastKindSpelling
}
}
- public CX_CharacterKind CharacterLiteralKind => clangsharp.Cursor_getCharacterLiteralKind(this);
+ public readonly CX_CharacterKind CharacterLiteralKind => clangsharp.Cursor_getCharacterLiteralKind(this);
- public uint CharacterLiteralValue => clangsharp.Cursor_getCharacterLiteralValue(this);
+ public readonly uint CharacterLiteralValue => clangsharp.Cursor_getCharacterLiteralValue(this);
- public CXSourceRange CommentRange => clang.Cursor_getCommentRange(this);
+ public readonly CXSourceRange CommentRange => clang.Cursor_getCommentRange(this);
- public CXCompletionString CompletionString => (CXCompletionString)clang.getCursorCompletionString(this);
+ public readonly CXCompletionString CompletionString => (CXCompletionString)clang.getCursorCompletionString(this);
- public CXType ComputationLhsType => clangsharp.Cursor_getComputationLhsType(this);
+ public readonly CXType ComputationLhsType => clangsharp.Cursor_getComputationLhsType(this);
- public CXType ComputationResultType => clangsharp.Cursor_getComputationResultType(this);
+ public readonly CXType ComputationResultType => clangsharp.Cursor_getComputationResultType(this);
- public CXCursor ConstraintExpr => clangsharp.Cursor_getConstraintExpr(this);
+ public readonly CXCursor ConstraintExpr => clangsharp.Cursor_getConstraintExpr(this);
- public CXCursor ConstructedBaseClass => clangsharp.Cursor_getConstructedBaseClass(this);
+ public readonly CXCursor ConstructedBaseClass => clangsharp.Cursor_getConstructedBaseClass(this);
- public CXCursor ConstructedBaseClassShadowDecl => clangsharp.Cursor_getConstructedBaseClassShadowDecl(this);
+ public readonly CXCursor ConstructedBaseClassShadowDecl => clangsharp.Cursor_getConstructedBaseClassShadowDecl(this);
- public CX_ConstructionKind ConstructionKind => clangsharp.Cursor_getConstructionKind(this);
+ public readonly CX_ConstructionKind ConstructionKind => clangsharp.Cursor_getConstructionKind(this);
- public bool ConstructsVirtualBase => clangsharp.Cursor_getConstructsVirtualBase(this) != 0;
+ public readonly bool ConstructsVirtualBase => clangsharp.Cursor_getConstructsVirtualBase(this) != 0;
- public CXCursor ContextParam => clangsharp.Cursor_getContextParam(this);
+ public readonly CXCursor ContextParam => clangsharp.Cursor_getContextParam(this);
- public int ContextParamPosition => clangsharp.Cursor_getContextParamPosition(this);
+ public readonly int ContextParamPosition => clangsharp.Cursor_getContextParamPosition(this);
- public CX_CXXAccessSpecifier CXXAccessSpecifier => clang.getCXXAccessSpecifier(this);
+ public readonly CX_CXXAccessSpecifier CXXAccessSpecifier => clang.getCXXAccessSpecifier(this);
- public bool BoolLiteralValue => clangsharp.Cursor_getBoolLiteralValue(this) != 0;
+ public readonly bool BoolLiteralValue => clangsharp.Cursor_getBoolLiteralValue(this) != 0;
- public bool CXXConstructor_IsConvertingConstructor => clang.CXXConstructor_isConvertingConstructor(this) != 0;
+ public readonly bool CXXConstructor_IsConvertingConstructor => clang.CXXConstructor_isConvertingConstructor(this) != 0;
- public bool CXXConstructor_IsCopyConstructor => clang.CXXConstructor_isCopyConstructor(this) != 0;
+ public readonly bool CXXConstructor_IsCopyConstructor => clang.CXXConstructor_isCopyConstructor(this) != 0;
- public bool CXXConstructor_IsDefaultConstructor => clang.CXXConstructor_isDefaultConstructor(this) != 0;
+ public readonly bool CXXConstructor_IsDefaultConstructor => clang.CXXConstructor_isDefaultConstructor(this) != 0;
- public bool CXXConstructor_IsMoveConstructor => clang.CXXConstructor_isMoveConstructor(this) != 0;
+ public readonly bool CXXConstructor_IsMoveConstructor => clang.CXXConstructor_isMoveConstructor(this) != 0;
- public bool CXXField_IsMutable => clang.CXXField_isMutable(this) != 0;
+ public readonly bool CXXField_IsMutable => clang.CXXField_isMutable(this) != 0;
- public CXStringSet* CXXManglings => clang.Cursor_getCXXManglings(this);
+ public readonly CXStringSet* CXXManglings => clang.Cursor_getCXXManglings(this);
- public bool CXXMethod_IsConst => clang.CXXMethod_isConst(this) != 0;
+ public readonly bool CXXMethod_IsConst => clang.CXXMethod_isConst(this) != 0;
- public bool CXXMethod_IsCopyAssignmentOperator => clang.CXXMethod_isCopyAssignmentOperator(this) != 0;
+ public readonly bool CXXMethod_IsCopyAssignmentOperator => clang.CXXMethod_isCopyAssignmentOperator(this) != 0;
- public bool CXXMethod_IsDefaulted => clang.CXXMethod_isDefaulted(this) != 0;
+ public readonly bool CXXMethod_IsDefaulted => clang.CXXMethod_isDefaulted(this) != 0;
- public bool CXXMethod_IsMoveAssignmentOperator => clang.CXXMethod_isMoveAssignmentOperator(this) != 0;
+ public readonly bool CXXMethod_IsMoveAssignmentOperator => clang.CXXMethod_isMoveAssignmentOperator(this) != 0;
- public bool CXXMethod_IsPureVirtual => clang.CXXMethod_isPureVirtual(this) != 0;
+ public readonly bool CXXMethod_IsPureVirtual => clang.CXXMethod_isPureVirtual(this) != 0;
- public bool CXXMethod_IsStatic => clang.CXXMethod_isStatic(this) != 0;
+ public readonly bool CXXMethod_IsStatic => clang.CXXMethod_isStatic(this) != 0;
- public bool CXXMethod_IsVirtual => clang.CXXMethod_isVirtual(this) != 0;
+ public readonly bool CXXMethod_IsVirtual => clang.CXXMethod_isVirtual(this) != 0;
- public bool CXXRecord_IsAbstract => clang.CXXRecord_isAbstract(this) != 0;
+ public readonly bool CXXRecord_IsAbstract => clang.CXXRecord_isAbstract(this) != 0;
- public CXType DeclaredReturnType => clangsharp.Cursor_getDeclaredReturnType(this);
+ public readonly CXType DeclaredReturnType => clangsharp.Cursor_getDeclaredReturnType(this);
- public CX_DeclKind DeclKind => clangsharp.Cursor_getDeclKind(this);
+ public readonly CX_DeclKind DeclKind => clangsharp.Cursor_getDeclKind(this);
- public string DeclKindSpelling
+ public readonly string DeclKindSpelling
{
get
{
@@ -769,409 +769,409 @@ public string DeclKindSpelling
}
}
- public CXString DeclObjCTypeEncoding => clang.getDeclObjCTypeEncoding(this);
+ public readonly CXString DeclObjCTypeEncoding => clang.getDeclObjCTypeEncoding(this);
- public CXCursor DecomposedDecl => clangsharp.Cursor_getDecomposedDecl(this);
+ public readonly CXCursor DecomposedDecl => clangsharp.Cursor_getDecomposedDecl(this);
- public CXCursor DefaultArg => clangsharp.Cursor_getDefaultArg(this);
+ public readonly CXCursor DefaultArg => clangsharp.Cursor_getDefaultArg(this);
- public CXType DefaultArgType => clangsharp.Cursor_getDefaultArgType(this);
+ public readonly CXType DefaultArgType => clangsharp.Cursor_getDefaultArgType(this);
- public CXCursor Definition => clangsharp.Cursor_getDefinition(this);
+ public readonly CXCursor Definition => clangsharp.Cursor_getDefinition(this);
- public CXCursor DependentLambdaCallOperator => clangsharp.Cursor_getDependentLambdaCallOperator(this);
+ public readonly CXCursor DependentLambdaCallOperator => clangsharp.Cursor_getDependentLambdaCallOperator(this);
- public CXCursor DescribedCursorTemplate => clangsharp.Cursor_getDescribedCursorTemplate(this);
+ public readonly CXCursor DescribedCursorTemplate => clangsharp.Cursor_getDescribedCursorTemplate(this);
- public CXCursor DescribedTemplate => clangsharp.Cursor_getDescribedTemplate(this);
+ public readonly CXCursor DescribedTemplate => clangsharp.Cursor_getDescribedTemplate(this);
- public CXCursor Destructor => clangsharp.Cursor_getDestructor(this);
+ public readonly CXCursor Destructor => clangsharp.Cursor_getDestructor(this);
- public CXString DisplayName => clang.getCursorDisplayName(this);
+ public readonly CXString DisplayName => clang.getCursorDisplayName(this);
- public bool DoesNotEscape => clangsharp.Cursor_getDoesNotEscape(this) != 0;
+ public readonly bool DoesNotEscape => clangsharp.Cursor_getDoesNotEscape(this) != 0;
- public bool DoesUsualArrayDeleteWantSize => clangsharp.Cursor_getDoesUsualArrayDeleteWantSize(this) != 0;
+ public readonly bool DoesUsualArrayDeleteWantSize => clangsharp.Cursor_getDoesUsualArrayDeleteWantSize(this) != 0;
- public ulong EnumConstantDeclUnsignedValue => clang.getEnumConstantDeclUnsignedValue(this);
+ public readonly ulong EnumConstantDeclUnsignedValue => clang.getEnumConstantDeclUnsignedValue(this);
- public long EnumConstantDeclValue => clang.getEnumConstantDeclValue(this);
+ public readonly long EnumConstantDeclValue => clang.getEnumConstantDeclValue(this);
- public CXType EnumDecl_IntegerType => clang.getEnumDeclIntegerType(this);
+ public readonly CXType EnumDecl_IntegerType => clang.getEnumDeclIntegerType(this);
- public bool EnumDecl_IsScoped => clang.EnumDecl_isScoped(this) != 0;
+ public readonly bool EnumDecl_IsScoped => clang.EnumDecl_isScoped(this) != 0;
- public CXType EnumDecl_PromotionType => clangsharp.Cursor_getEnumDeclPromotionType(this);
+ public readonly CXType EnumDecl_PromotionType => clangsharp.Cursor_getEnumDeclPromotionType(this);
- public CXEvalResult Evaluate => (CXEvalResult)clang.Cursor_Evaluate(this);
+ public readonly CXEvalResult Evaluate => (CXEvalResult)clang.Cursor_Evaluate(this);
- public int ExceptionSpecificationType => clang.getCursorExceptionSpecificationType(this);
+ public readonly int ExceptionSpecificationType => clang.getCursorExceptionSpecificationType(this);
- public CX_ExprDependence ExprDependence => clangsharp.Cursor_getExprDependence(this);
+ public readonly CX_ExprDependence ExprDependence => clangsharp.Cursor_getExprDependence(this);
- public CXSourceRange Extent => clang.getCursorExtent(this);
+ public readonly CXSourceRange Extent => clang.getCursorExtent(this);
- public CX_FloatingSemantics FloatingLiteralSemantics => clangsharp.Cursor_getFloatingLiteralSemantics(this);
+ public readonly CX_FloatingSemantics FloatingLiteralSemantics => clangsharp.Cursor_getFloatingLiteralSemantics(this);
- public double FloatingLiteralValueAsApproximateDouble => clangsharp.Cursor_getFloatingLiteralValueAsApproximateDouble(this);
+ public readonly double FloatingLiteralValueAsApproximateDouble => clangsharp.Cursor_getFloatingLiteralValueAsApproximateDouble(this);
- public int FieldDeclBitWidth => clang.getFieldDeclBitWidth(this);
+ public readonly int FieldDeclBitWidth => clang.getFieldDeclBitWidth(this);
- public int FieldIndex => clangsharp.Cursor_getFieldIndex(this);
+ public readonly int FieldIndex => clangsharp.Cursor_getFieldIndex(this);
- public CXCursor FoundDecl => clangsharp.Cursor_getFoundDecl(this);
+ public readonly CXCursor FoundDecl => clangsharp.Cursor_getFoundDecl(this);
- public CXCursor FriendDecl => clangsharp.Cursor_getFriendDecl(this);
+ public readonly CXCursor FriendDecl => clangsharp.Cursor_getFriendDecl(this);
- public int FunctionScopeDepth => clangsharp.Cursor_getFunctionScopeDepth(this);
+ public readonly int FunctionScopeDepth => clangsharp.Cursor_getFunctionScopeDepth(this);
- public int FunctionScopeIndex => clangsharp.Cursor_getFunctionScopeIndex(this);
+ public readonly int FunctionScopeIndex => clangsharp.Cursor_getFunctionScopeIndex(this);
- public Guid GuidValue => clangsharp.Cursor_getGuidValue(this);
+ public readonly Guid GuidValue => clangsharp.Cursor_getGuidValue(this);
- public bool HadMultipleCandidates => clangsharp.Cursor_getHadMultipleCandidates(this) != 0;
+ public readonly bool HadMultipleCandidates => clangsharp.Cursor_getHadMultipleCandidates(this) != 0;
- public bool HasAttrs => clang.Cursor_hasAttrs(this) != 0;
+ public readonly bool HasAttrs => clang.Cursor_hasAttrs(this) != 0;
- public bool HasBody => clangsharp.Cursor_getHasBody(this) != 0;
+ public readonly bool HasBody => clangsharp.Cursor_getHasBody(this) != 0;
- public bool HasDefaultArg => clangsharp.Cursor_getHasDefaultArg(this) != 0;
+ public readonly bool HasDefaultArg => clangsharp.Cursor_getHasDefaultArg(this) != 0;
- public bool HasElseStorage => clangsharp.Cursor_getHasElseStorage(this) != 0;
+ public readonly bool HasElseStorage => clangsharp.Cursor_getHasElseStorage(this) != 0;
- public bool HasExplicitTemplateArgs => clangsharp.Cursor_getHasExplicitTemplateArgs(this) != 0;
+ public readonly bool HasExplicitTemplateArgs => clangsharp.Cursor_getHasExplicitTemplateArgs(this) != 0;
- public bool HasImplicitReturnZero => clangsharp.Cursor_getHasImplicitReturnZero(this) != 0;
+ public readonly bool HasImplicitReturnZero => clangsharp.Cursor_getHasImplicitReturnZero(this) != 0;
- public bool HasInheritedDefaultArg => clangsharp.Cursor_getHasInheritedDefaultArg(this) != 0;
+ public readonly bool HasInheritedDefaultArg => clangsharp.Cursor_getHasInheritedDefaultArg(this) != 0;
- public bool HasInit => clangsharp.Cursor_getHasInit(this) != 0;
+ public readonly bool HasInit => clangsharp.Cursor_getHasInit(this) != 0;
- public bool HasInitStorage => clangsharp.Cursor_getHasInitStorage(this) != 0;
+ public readonly bool HasInitStorage => clangsharp.Cursor_getHasInitStorage(this) != 0;
- public bool HasLeadingEmptyMacro => clangsharp.Cursor_getHasLeadingEmptyMacro(this) != 0;
+ public readonly bool HasLeadingEmptyMacro => clangsharp.Cursor_getHasLeadingEmptyMacro(this) != 0;
- public bool HasLocalStorage => clangsharp.Cursor_getHasLocalStorage(this) != 0;
+ public readonly bool HasLocalStorage => clangsharp.Cursor_getHasLocalStorage(this) != 0;
- public bool HasPlaceholderTypeConstraint => clangsharp.Cursor_getHasPlaceholderTypeConstraint(this) != 0;
+ public readonly bool HasPlaceholderTypeConstraint => clangsharp.Cursor_getHasPlaceholderTypeConstraint(this) != 0;
- public uint Hash => clang.hashCursor(this);
+ public readonly uint Hash => clang.hashCursor(this);
- public bool HasTemplateKeyword => clangsharp.Cursor_getHasTemplateKeyword(this) != 0;
+ public readonly bool HasTemplateKeyword => clangsharp.Cursor_getHasTemplateKeyword(this) != 0;
- public bool HasUserDeclaredConstructor => clangsharp.Cursor_getHasUserDeclaredConstructor(this) != 0;
+ public readonly bool HasUserDeclaredConstructor => clangsharp.Cursor_getHasUserDeclaredConstructor(this) != 0;
- public bool HasUserDeclaredCopyAssignment => clangsharp.Cursor_getHasUserDeclaredCopyAssignment(this) != 0;
+ public readonly bool HasUserDeclaredCopyAssignment => clangsharp.Cursor_getHasUserDeclaredCopyAssignment(this) != 0;
- public bool HasUserDeclaredCopyConstructor => clangsharp.Cursor_getHasUserDeclaredCopyConstructor(this) != 0;
+ public readonly bool HasUserDeclaredCopyConstructor => clangsharp.Cursor_getHasUserDeclaredCopyConstructor(this) != 0;
- public bool HasUserDeclaredDestructor => clangsharp.Cursor_getHasUserDeclaredDestructor(this) != 0;
+ public readonly bool HasUserDeclaredDestructor => clangsharp.Cursor_getHasUserDeclaredDestructor(this) != 0;
- public bool HasUserDeclaredMoveAssignment => clangsharp.Cursor_getHasUserDeclaredMoveAssignment(this) != 0;
+ public readonly bool HasUserDeclaredMoveAssignment => clangsharp.Cursor_getHasUserDeclaredMoveAssignment(this) != 0;
- public bool HasUserDeclaredMoveConstructor => clangsharp.Cursor_getHasUserDeclaredMoveConstructor(this) != 0;
+ public readonly bool HasUserDeclaredMoveConstructor => clangsharp.Cursor_getHasUserDeclaredMoveConstructor(this) != 0;
- public bool HasUserDeclaredMoveOperation => clangsharp.Cursor_getHasUserDeclaredMoveOperation(this) != 0;
+ public readonly bool HasUserDeclaredMoveOperation => clangsharp.Cursor_getHasUserDeclaredMoveOperation(this) != 0;
- public bool HasVarDeclExternalStorage => clang.Cursor_hasVarDeclExternalStorage(this) != 0;
+ public readonly bool HasVarDeclExternalStorage => clang.Cursor_hasVarDeclExternalStorage(this) != 0;
- public bool HasVarDeclGlobalStorage => clang.Cursor_hasVarDeclGlobalStorage(this) != 0;
+ public readonly bool HasVarDeclGlobalStorage => clang.Cursor_hasVarDeclGlobalStorage(this) != 0;
- public bool HasVarStorage => clangsharp.Cursor_getHasVarStorage(this) != 0;
+ public readonly bool HasVarStorage => clangsharp.Cursor_getHasVarStorage(this) != 0;
- public CXType IBOutletCollectionType => clang.getIBOutletCollectionType(this);
+ public readonly CXType IBOutletCollectionType => clang.getIBOutletCollectionType(this);
- public CXFile IncludedFile => (CXFile)clang.getIncludedFile(this);
+ public readonly CXFile IncludedFile => (CXFile)clang.getIncludedFile(this);
- public CXCursor InClassInitializer => clangsharp.Cursor_getInClassInitializer(this);
+ public readonly CXCursor InClassInitializer => clangsharp.Cursor_getInClassInitializer(this);
- public CXCursor InheritedConstructor => clangsharp.Cursor_getInheritedConstructor(this);
+ public readonly CXCursor InheritedConstructor => clangsharp.Cursor_getInheritedConstructor(this);
- public bool InheritedFromVBase => clangsharp.Cursor_getInheritedFromVBase(this) != 0;
+ public readonly bool InheritedFromVBase => clangsharp.Cursor_getInheritedFromVBase(this) != 0;
- public CXCursor InitExpr => clangsharp.Cursor_getInitExpr(this);
+ public readonly CXCursor InitExpr => clangsharp.Cursor_getInitExpr(this);
- public CXType InjectedSpecializationType => clangsharp.Cursor_getInjectedSpecializationType(this);
+ public readonly CXType InjectedSpecializationType => clangsharp.Cursor_getInjectedSpecializationType(this);
- public CXCursor InstantiatedFromMember => clangsharp.Cursor_getInstantiatedFromMember(this);
+ public readonly CXCursor InstantiatedFromMember => clangsharp.Cursor_getInstantiatedFromMember(this);
- public long IntegerLiteralValue => clangsharp.Cursor_getIntegerLiteralValue(this);
+ public readonly long IntegerLiteralValue => clangsharp.Cursor_getIntegerLiteralValue(this);
- public bool IsAllEnumCasesCovered => clangsharp.Cursor_getIsAllEnumCasesCovered(this) != 0;
+ public readonly bool IsAllEnumCasesCovered => clangsharp.Cursor_getIsAllEnumCasesCovered(this) != 0;
- public bool IsAlwaysNull => clangsharp.Cursor_getIsAlwaysNull(this) != 0;
+ public readonly bool IsAlwaysNull => clangsharp.Cursor_getIsAlwaysNull(this) != 0;
- public bool IsAnonymous => clang.Cursor_isAnonymous(this) != 0;
+ public readonly bool IsAnonymous => clang.Cursor_isAnonymous(this) != 0;
- public bool IsAnonymousRecordDecl => clang.Cursor_isAnonymousRecordDecl(this) != 0;
+ public readonly bool IsAnonymousRecordDecl => clang.Cursor_isAnonymousRecordDecl(this) != 0;
- public bool IsAnonymousStructOrUnion => clangsharp.Cursor_getIsAnonymousStructOrUnion(this) != 0;
+ public readonly bool IsAnonymousStructOrUnion => clangsharp.Cursor_getIsAnonymousStructOrUnion(this) != 0;
- public bool IsArgumentType => clangsharp.Cursor_getIsArgumentType(this) != 0;
+ public readonly bool IsArgumentType => clangsharp.Cursor_getIsArgumentType(this) != 0;
- public bool IsArrayForm => clangsharp.Cursor_getIsArrayForm(this) != 0;
+ public readonly bool IsArrayForm => clangsharp.Cursor_getIsArrayForm(this) != 0;
- public bool IsArrayFormAsWritten => clangsharp.Cursor_getIsArrayFormAsWritten(this) != 0;
+ public readonly bool IsArrayFormAsWritten => clangsharp.Cursor_getIsArrayFormAsWritten(this) != 0;
- public bool IsArrow => clangsharp.Cursor_getIsArrow(this) != 0;
+ public readonly bool IsArrow => clangsharp.Cursor_getIsArrow(this) != 0;
- public bool IsAttribute => clang.isAttribute(Kind) != 0;
+ public readonly bool IsAttribute => clang.isAttribute(Kind) != 0;
- public bool IsBitField => clang.Cursor_isBitField(this) != 0;
+ public readonly bool IsBitField => clang.Cursor_isBitField(this) != 0;
- public bool IsCanonical => Equals(CanonicalCursor);
+ public readonly bool IsCanonical => Equals(CanonicalCursor);
- public bool IsCBuffer => clangsharp.Cursor_getIsCBuffer(this) != 0;
+ public readonly bool IsCBuffer => clangsharp.Cursor_getIsCBuffer(this) != 0;
- public bool IsClassExtension => clangsharp.Cursor_getIsClassExtension(this) != 0;
+ public readonly bool IsClassExtension => clangsharp.Cursor_getIsClassExtension(this) != 0;
- public bool IsCompleteDefinition => clangsharp.Cursor_getIsCompleteDefinition(this) != 0;
+ public readonly bool IsCompleteDefinition => clangsharp.Cursor_getIsCompleteDefinition(this) != 0;
- public bool IsConditionTrue => clangsharp.Cursor_getIsConditionTrue(this) != 0;
+ public readonly bool IsConditionTrue => clangsharp.Cursor_getIsConditionTrue(this) != 0;
- public bool IsConstexpr => clangsharp.Cursor_getIsConstexpr(this) != 0;
+ public readonly bool IsConstexpr => clangsharp.Cursor_getIsConstexpr(this) != 0;
- public bool IsConversionFromLambda => clangsharp.Cursor_getIsConversionFromLambda(this) != 0;
+ public readonly bool IsConversionFromLambda => clangsharp.Cursor_getIsConversionFromLambda(this) != 0;
- public bool IsCopyOrMoveConstructor => clangsharp.Cursor_getIsCopyOrMoveConstructor(this) != 0;
+ public readonly bool IsCopyOrMoveConstructor => clangsharp.Cursor_getIsCopyOrMoveConstructor(this) != 0;
- public bool IsCXXTry => clangsharp.Cursor_getIsCXXTry(this) != 0;
+ public readonly bool IsCXXTry => clangsharp.Cursor_getIsCXXTry(this) != 0;
- public bool IsDeclaration => clang.isDeclaration(Kind) != 0;
+ public readonly bool IsDeclaration => clang.isDeclaration(Kind) != 0;
- public bool IsDefined => clangsharp.Cursor_getIsDefined(this) != 0;
+ public readonly bool IsDefined => clangsharp.Cursor_getIsDefined(this) != 0;
- public bool IsDefinition => clang.isCursorDefinition(this) != 0;
+ public readonly bool IsDefinition => clang.isCursorDefinition(this) != 0;
- public bool IsDelegatingConstructor => clangsharp.Cursor_getIsDelegatingConstructor(this) != 0;
+ public readonly bool IsDelegatingConstructor => clangsharp.Cursor_getIsDelegatingConstructor(this) != 0;
- public bool IsDeleted => clangsharp.Cursor_getIsDeleted(this) != 0;
+ public readonly bool IsDeleted => clangsharp.Cursor_getIsDeleted(this) != 0;
- public bool IsDeprecated => clangsharp.Cursor_getIsDeprecated(this) != 0;
+ public readonly bool IsDeprecated => clangsharp.Cursor_getIsDeprecated(this) != 0;
- public bool IsDynamicCall => clang.Cursor_isDynamicCall(this) != 0;
+ public readonly bool IsDynamicCall => clang.Cursor_isDynamicCall(this) != 0;
- public bool IsElidable => clangsharp.Cursor_getIsElidable(this) != 0;
+ public readonly bool IsElidable => clangsharp.Cursor_getIsElidable(this) != 0;
- public bool IsExplicitlyDefaulted => clangsharp.Cursor_getIsExplicitlyDefaulted(this) != 0;
+ public readonly bool IsExplicitlyDefaulted => clangsharp.Cursor_getIsExplicitlyDefaulted(this) != 0;
- public bool IsExpression => clang.isExpression(Kind) != 0;
+ public readonly bool IsExpression => clang.isExpression(Kind) != 0;
- public bool IsExternC => clangsharp.Cursor_getIsExternC(this) != 0;
+ public readonly bool IsExternC => clangsharp.Cursor_getIsExternC(this) != 0;
- public bool IsExpandedParameterPack => clangsharp.Cursor_getIsExpandedParameterPack(this) != 0;
+ public readonly bool IsExpandedParameterPack => clangsharp.Cursor_getIsExpandedParameterPack(this) != 0;
- public bool IsFileScope => clangsharp.Cursor_getIsFileScope(this) != 0;
+ public readonly bool IsFileScope => clangsharp.Cursor_getIsFileScope(this) != 0;
- public bool IsFunctionInlined => clang.Cursor_isFunctionInlined(this) != 0;
+ public readonly bool IsFunctionInlined => clang.Cursor_isFunctionInlined(this) != 0;
- public bool IsGlobal => clangsharp.Cursor_getIsGlobal(this) != 0;
+ public readonly bool IsGlobal => clangsharp.Cursor_getIsGlobal(this) != 0;
- public bool IsInjectedClassName => clangsharp.Cursor_getIsInjectedClassName(this) != 0;
+ public readonly bool IsInjectedClassName => clangsharp.Cursor_getIsInjectedClassName(this) != 0;
- public bool IsInlineNamespace => clang.Cursor_isInlineNamespace(this) != 0;
+ public readonly bool IsInlineNamespace => clang.Cursor_isInlineNamespace(this) != 0;
- public bool IsIfExists => clangsharp.Cursor_getIsIfExists(this) != 0;
+ public readonly bool IsIfExists => clangsharp.Cursor_getIsIfExists(this) != 0;
- public bool IsImplicit => clangsharp.Cursor_getIsImplicit(this) != 0;
+ public readonly bool IsImplicit => clangsharp.Cursor_getIsImplicit(this) != 0;
- public bool IsIncomplete => clangsharp.Cursor_getIsIncomplete(this) != 0;
+ public readonly bool IsIncomplete => clangsharp.Cursor_getIsIncomplete(this) != 0;
- public bool IsInheritingConstructor => clangsharp.Cursor_getIsInheritingConstructor(this) != 0;
+ public readonly bool IsInheritingConstructor => clangsharp.Cursor_getIsInheritingConstructor(this) != 0;
- public bool IsInvalid => clang.isInvalid(Kind) != 0;
+ public readonly bool IsInvalid => clang.isInvalid(Kind) != 0;
- public bool IsInvalidDeclaration => clang.isInvalidDeclaration(this) != 0;
+ public readonly bool IsInvalidDeclaration => clang.isInvalidDeclaration(this) != 0;
- public bool IsListInitialization => clangsharp.Cursor_getIsListInitialization(this) != 0;
+ public readonly bool IsListInitialization => clangsharp.Cursor_getIsListInitialization(this) != 0;
- public bool IsLocalVarDecl => clangsharp.Cursor_getIsLocalVarDecl(this) != 0;
+ public readonly bool IsLocalVarDecl => clangsharp.Cursor_getIsLocalVarDecl(this) != 0;
- public bool IsLocalVarDeclOrParm => clangsharp.Cursor_getIsLocalVarDeclOrParm(this) != 0;
+ public readonly bool IsLocalVarDeclOrParm => clangsharp.Cursor_getIsLocalVarDeclOrParm(this) != 0;
- public bool IsMacroBuiltIn => clang.Cursor_isMacroBuiltin(this) != 0;
+ public readonly bool IsMacroBuiltIn => clang.Cursor_isMacroBuiltin(this) != 0;
- public bool IsMacroFunctionLike => clang.Cursor_isMacroFunctionLike(this) != 0;
+ public readonly bool IsMacroFunctionLike => clang.Cursor_isMacroFunctionLike(this) != 0;
- public bool IsMemberSpecialization => clangsharp.Cursor_getIsMemberSpecialization(this) != 0;
+ public readonly bool IsMemberSpecialization => clangsharp.Cursor_getIsMemberSpecialization(this) != 0;
- public bool IsNegative => clangsharp.Cursor_getIsNegative(this) != 0;
+ public readonly bool IsNegative => clangsharp.Cursor_getIsNegative(this) != 0;
- public bool IsNonNegative => clangsharp.Cursor_getIsNonNegative(this) != 0;
+ public readonly bool IsNonNegative => clangsharp.Cursor_getIsNonNegative(this) != 0;
- public bool IsNoReturn => clangsharp.Cursor_getIsNoReturn(this) != 0;
+ public readonly bool IsNoReturn => clangsharp.Cursor_getIsNoReturn(this) != 0;
- public bool IsNothrow => clangsharp.Cursor_getIsNothrow(this) != 0;
+ public readonly bool IsNothrow => clangsharp.Cursor_getIsNothrow(this) != 0;
- public bool IsNull => clang.Cursor_isNull(this) != 0;
+ public readonly bool IsNull => clang.Cursor_isNull(this) != 0;
- public bool IsObjCOptional => clang.Cursor_isObjCOptional(this) != 0;
+ public readonly bool IsObjCOptional => clang.Cursor_isObjCOptional(this) != 0;
- public bool IsOverloadedOperator => clangsharp.Cursor_getIsOverloadedOperator(this) != 0;
+ public readonly bool IsOverloadedOperator => clangsharp.Cursor_getIsOverloadedOperator(this) != 0;
- public bool IsPackExpansion => clangsharp.Cursor_getIsPackExpansion(this) != 0;
+ public readonly bool IsPackExpansion => clangsharp.Cursor_getIsPackExpansion(this) != 0;
- public bool IsParameterPack => clangsharp.Cursor_getIsParameterPack(this) != 0;
+ public readonly bool IsParameterPack => clangsharp.Cursor_getIsParameterPack(this) != 0;
- public bool IsPartiallySubstituted => clangsharp.Cursor_getIsPartiallySubstituted(this) != 0;
+ public readonly bool IsPartiallySubstituted => clangsharp.Cursor_getIsPartiallySubstituted(this) != 0;
- public bool IsPotentiallyEvaluated => clangsharp.Cursor_getIsPotentiallyEvaluated(this) != 0;
+ public readonly bool IsPotentiallyEvaluated => clangsharp.Cursor_getIsPotentiallyEvaluated(this) != 0;
- public bool IsPreprocessing => clang.isPreprocessing(Kind) != 0;
+ public readonly bool IsPreprocessing => clang.isPreprocessing(Kind) != 0;
- public bool IsPure => clangsharp.Cursor_getIsPure(this) != 0;
+ public readonly bool IsPure => clangsharp.Cursor_getIsPure(this) != 0;
- public bool IsReference => clang.isReference(Kind) != 0;
+ public readonly bool IsReference => clang.isReference(Kind) != 0;
- public bool IsResultDependent => clangsharp.Cursor_getIsResultDependent(this) != 0;
+ public readonly bool IsResultDependent => clangsharp.Cursor_getIsResultDependent(this) != 0;
- public bool IsStdInitListInitialization => clangsharp.Cursor_getIsStdInitListInitialization(this) != 0;
+ public readonly bool IsStdInitListInitialization => clangsharp.Cursor_getIsStdInitListInitialization(this) != 0;
- public bool IsSigned => clangsharp.Cursor_getIsSigned(this) != 0;
+ public readonly bool IsSigned => clangsharp.Cursor_getIsSigned(this) != 0;
- public bool IsStatement => clang.isStatement(Kind) != 0;
+ public readonly bool IsStatement => clang.isStatement(Kind) != 0;
- public bool IsStatic => clangsharp.Cursor_getIsStatic(this) != 0;
+ public readonly bool IsStatic => clangsharp.Cursor_getIsStatic(this) != 0;
- public bool IsStaticDataMember => clangsharp.Cursor_getIsStaticDataMember(this) != 0;
+ public readonly bool IsStaticDataMember => clangsharp.Cursor_getIsStaticDataMember(this) != 0;
- public bool IsStrictlyPositive => clangsharp.Cursor_getIsStrictlyPositive(this) != 0;
+ public readonly bool IsStrictlyPositive => clangsharp.Cursor_getIsStrictlyPositive(this) != 0;
- public bool IsTemplated => clangsharp.Cursor_getIsTemplated(this) != 0;
+ public readonly bool IsTemplated => clangsharp.Cursor_getIsTemplated(this) != 0;
- public bool IsThisDeclarationADefinition => clangsharp.Cursor_getIsThisDeclarationADefinition(this) != 0;
+ public readonly bool IsThisDeclarationADefinition => clangsharp.Cursor_getIsThisDeclarationADefinition(this) != 0;
- public bool IsThrownVariableInScope => clangsharp.Cursor_getIsThrownVariableInScope(this) != 0;
+ public readonly bool IsThrownVariableInScope => clangsharp.Cursor_getIsThrownVariableInScope(this) != 0;
- public bool IsTranslationUnit => clang.isTranslationUnit(Kind) != 0;
+ public readonly bool IsTranslationUnit => clang.isTranslationUnit(Kind) != 0;
- public bool IsTransparent => clangsharp.Cursor_getIsTransparent(this) != 0;
+ public readonly bool IsTransparent => clangsharp.Cursor_getIsTransparent(this) != 0;
- public bool IsTypeConcept => clangsharp.Cursor_getIsTypeConcept(this) != 0;
+ public readonly bool IsTypeConcept => clangsharp.Cursor_getIsTypeConcept(this) != 0;
- public bool IsUnavailable => clangsharp.Cursor_getIsUnavailable(this) != 0;
+ public readonly bool IsUnavailable => clangsharp.Cursor_getIsUnavailable(this) != 0;
- public bool IsUnconditionallyVisible => clangsharp.Cursor_getIsUnconditionallyVisible(this) != 0;
+ public readonly bool IsUnconditionallyVisible => clangsharp.Cursor_getIsUnconditionallyVisible(this) != 0;
- public bool IsUnexposed => clang.isUnexposed(Kind) != 0;
+ public readonly bool IsUnexposed => clang.isUnexposed(Kind) != 0;
- public bool IsUnnamedBitfield => clangsharp.Cursor_getIsUnnamedBitfield(this) != 0;
+ public readonly bool IsUnnamedBitfield => clangsharp.Cursor_getIsUnnamedBitfield(this) != 0;
- public bool IsUnsigned => clangsharp.Cursor_getIsUnsigned(this) != 0;
+ public readonly bool IsUnsigned => clangsharp.Cursor_getIsUnsigned(this) != 0;
- public bool IsUnsupportedFriend => clangsharp.Cursor_getIsUnsupportedFriend(this) != 0;
+ public readonly bool IsUnsupportedFriend => clangsharp.Cursor_getIsUnsupportedFriend(this) != 0;
- public bool IsUserProvided => clangsharp.Cursor_getIsUserProvided(this) != 0;
+ public readonly bool IsUserProvided => clangsharp.Cursor_getIsUserProvided(this) != 0;
- public bool IsVariadic => clangsharp.Cursor_getIsVariadic(this) != 0;
+ public readonly bool IsVariadic => clangsharp.Cursor_getIsVariadic(this) != 0;
- public bool IsVirtualBase => clang.isVirtualBase(this) != 0;
+ public readonly bool IsVirtualBase => clang.isVirtualBase(this) != 0;
- public CXCursorKind Kind => clang.getCursorKind(this);
+ public readonly CXCursorKind Kind => clang.getCursorKind(this);
- public CXString KindSpelling => (kind != default) ? clang.getCursorKindSpelling(Kind) : default;
+ public readonly CXString KindSpelling => (kind != default) ? clang.getCursorKindSpelling(Kind) : default;
- public CXCursor LambdaCallOperator => clangsharp.Cursor_getLambdaCallOperator(this);
+ public readonly CXCursor LambdaCallOperator => clangsharp.Cursor_getLambdaCallOperator(this);
- public CXCursor LambdaContextDecl => clangsharp.Cursor_getLambdaContextDecl(this);
+ public readonly CXCursor LambdaContextDecl => clangsharp.Cursor_getLambdaContextDecl(this);
- public CXCursor LambdaStaticInvoker => clangsharp.Cursor_getLambdaStaticInvoker(this);
+ public readonly CXCursor LambdaStaticInvoker => clangsharp.Cursor_getLambdaStaticInvoker(this);
- public CXLanguageKind Language => clang.getCursorLanguage(this);
+ public readonly CXLanguageKind Language => clang.getCursorLanguage(this);
- public CXCursor LexicalParent => clang.getCursorLexicalParent(this);
+ public readonly CXCursor LexicalParent => clang.getCursorLexicalParent(this);
- public CXCursor LhsExpr => clangsharp.Cursor_getLhsExpr(this);
+ public readonly CXCursor LhsExpr => clangsharp.Cursor_getLhsExpr(this);
- public CXLinkageKind Linkage => clang.getCursorLinkage(this);
+ public readonly CXLinkageKind Linkage => clang.getCursorLinkage(this);
- public CXSourceLocation Location => clang.getCursorLocation(this);
+ public readonly CXSourceLocation Location => clang.getCursorLocation(this);
- public CXString Mangling => clang.Cursor_getMangling(this);
+ public readonly CXString Mangling => clang.Cursor_getMangling(this);
- public uint MaxAlignment => clangsharp.Cursor_getMaxAlignment(this);
+ public readonly uint MaxAlignment => clangsharp.Cursor_getMaxAlignment(this);
- public CXModule Module => (CXModule)clang.Cursor_getModule(this);
+ public readonly CXModule Module => (CXModule)clang.Cursor_getModule(this);
- public CXCursor MostRecentDecl => clangsharp.Cursor_getMostRecentDecl(this);
+ public readonly CXCursor MostRecentDecl => clangsharp.Cursor_getMostRecentDecl(this);
- public CXString Name => clangsharp.Cursor_getName(this);
+ public readonly CXString Name => clangsharp.Cursor_getName(this);
- public CXCursor NextDeclInContext => clangsharp.Cursor_getNextDeclInContext(this);
+ public readonly CXCursor NextDeclInContext => clangsharp.Cursor_getNextDeclInContext(this);
- public CXCursor NextSwitchCase => clangsharp.Cursor_getNextSwitchCase(this);
+ public readonly CXCursor NextSwitchCase => clangsharp.Cursor_getNextSwitchCase(this);
- public CXCursor NominatedBaseClass => clangsharp.Cursor_getNominatedBaseClass(this);
+ public readonly CXCursor NominatedBaseClass => clangsharp.Cursor_getNominatedBaseClass(this);
- public CXCursor NominatedBaseClassShadowDecl => clangsharp.Cursor_getNominatedBaseClassShadowDecl(this);
+ public readonly CXCursor NominatedBaseClassShadowDecl => clangsharp.Cursor_getNominatedBaseClassShadowDecl(this);
- public CXCursor NonClosureContext => clangsharp.Cursor_getNonClosureContext(this);
+ public readonly CXCursor NonClosureContext => clangsharp.Cursor_getNonClosureContext(this);
- public int NumAssociatedConstraints => clangsharp.Cursor_getNumAssociatedConstraints(this);
+ public readonly int NumAssociatedConstraints => clangsharp.Cursor_getNumAssociatedConstraints(this);
- public int NumArguments => clangsharp.Cursor_getNumArguments(this);
+ public readonly int NumArguments => clangsharp.Cursor_getNumArguments(this);
- public int NumAssocs => clangsharp.Cursor_getNumAssocs(this);
+ public readonly int NumAssocs => clangsharp.Cursor_getNumAssocs(this);
- public int NumAttrs => clangsharp.Cursor_getNumAttrs(this);
+ public readonly int NumAttrs => clangsharp.Cursor_getNumAttrs(this);
- public int NumBases => clangsharp.Cursor_getNumBases(this);
+ public readonly int NumBases => clangsharp.Cursor_getNumBases(this);
- public int NumBindings => clangsharp.Cursor_getNumBindings(this);
+ public readonly int NumBindings => clangsharp.Cursor_getNumBindings(this);
- public int NumCaptures => clangsharp.Cursor_getNumCaptures(this);
+ public readonly int NumCaptures => clangsharp.Cursor_getNumCaptures(this);
- public int NumChildren => clangsharp.Cursor_getNumChildren(this);
+ public readonly int NumChildren => clangsharp.Cursor_getNumChildren(this);
- public int NumCtors => clangsharp.Cursor_getNumCtors(this);
+ public readonly int NumCtors => clangsharp.Cursor_getNumCtors(this);
- public int NumDecls => clangsharp.Cursor_getNumDecls(this);
+ public readonly int NumDecls => clangsharp.Cursor_getNumDecls(this);
- public int NumEnumerators => clangsharp.Cursor_getNumEnumerators(this);
+ public readonly int NumEnumerators => clangsharp.Cursor_getNumEnumerators(this);
- public int NumExpansionTypes => clangsharp.Cursor_getNumExpansionTypes(this);
+ public readonly int NumExpansionTypes => clangsharp.Cursor_getNumExpansionTypes(this);
- public int NumExprs => clangsharp.Cursor_getNumExprs(this);
+ public readonly int NumExprs => clangsharp.Cursor_getNumExprs(this);
- public int NumExprsOther => clangsharp.Cursor_getNumExprsOther(this);
+ public readonly int NumExprsOther => clangsharp.Cursor_getNumExprsOther(this);
- public int NumFields => clangsharp.Cursor_getNumFields(this);
+ public readonly int NumFields => clangsharp.Cursor_getNumFields(this);
- public int NumFriends => clangsharp.Cursor_getNumFriends(this);
+ public readonly int NumFriends => clangsharp.Cursor_getNumFriends(this);
- public int NumMethods => clangsharp.Cursor_getNumMethods(this);
+ public readonly int NumMethods => clangsharp.Cursor_getNumMethods(this);
- public uint NumOverloadedDecls => clang.getNumOverloadedDecls(this);
+ public readonly uint NumOverloadedDecls => clang.getNumOverloadedDecls(this);
- public int NumProtocols => clangsharp.Cursor_getNumProtocols(this);
+ public readonly int NumProtocols => clangsharp.Cursor_getNumProtocols(this);
- public int NumSpecializations => clangsharp.Cursor_getNumSpecializations(this);
+ public readonly int NumSpecializations => clangsharp.Cursor_getNumSpecializations(this);
- public int NumTemplateArguments => clangsharp.Cursor_getNumTemplateArguments(this);
+ public readonly int NumTemplateArguments => clangsharp.Cursor_getNumTemplateArguments(this);
- public int NumTemplateParameterLists => clangsharp.Cursor_getNumTemplateParameterLists(this);
+ public readonly int NumTemplateParameterLists => clangsharp.Cursor_getNumTemplateParameterLists(this);
- public int NumVBases => clangsharp.Cursor_getNumVBases(this);
+ public readonly int NumVBases => clangsharp.Cursor_getNumVBases(this);
- public CXObjCDeclQualifierKind ObjCDeclQualifiers => (CXObjCDeclQualifierKind)clang.Cursor_getObjCDeclQualifiers(this);
+ public readonly CXObjCDeclQualifierKind ObjCDeclQualifiers => (CXObjCDeclQualifierKind)clang.Cursor_getObjCDeclQualifiers(this);
- public CXStringSet* ObjCManglings => clang.Cursor_getObjCManglings(this);
+ public readonly CXStringSet* ObjCManglings => clang.Cursor_getObjCManglings(this);
- public CXString ObjCPropertyGetterName => clang.Cursor_getObjCPropertyGetterName(this);
+ public readonly CXString ObjCPropertyGetterName => clang.Cursor_getObjCPropertyGetterName(this);
- public CXString ObjCPropertySetterName => clang.Cursor_getObjCPropertySetterName(this);
+ public readonly CXString ObjCPropertySetterName => clang.Cursor_getObjCPropertySetterName(this);
- public int ObjCSelectorIndex => clang.Cursor_getObjCSelectorIndex(this);
+ public readonly int ObjCSelectorIndex => clang.Cursor_getObjCSelectorIndex(this);
- public long OffsetOfField => clang.Cursor_getOffsetOfField(this);
+ public readonly long OffsetOfField => clang.Cursor_getOffsetOfField(this);
- public CXCursor OpaqueValue => clangsharp.Cursor_getOpaqueValue(this);
+ public readonly CXCursor OpaqueValue => clangsharp.Cursor_getOpaqueValue(this);
- public CXType OriginalType => clangsharp.Cursor_getOriginalType(this);
+ public readonly CXType OriginalType => clangsharp.Cursor_getOriginalType(this);
- public CX_OverloadedOperatorKind OverloadedOperatorKind => clangsharp.Cursor_getOverloadedOperatorKind(this);
+ public readonly CX_OverloadedOperatorKind OverloadedOperatorKind => clangsharp.Cursor_getOverloadedOperatorKind(this);
- public ReadOnlySpan OverriddenCursors
+ public readonly ReadOnlySpan OverriddenCursors
{
get
{
@@ -1183,53 +1183,53 @@ public ReadOnlySpan OverriddenCursors
}
}
- public int PackLength => clangsharp.Cursor_getPackLength(this);
+ public readonly int PackLength => clangsharp.Cursor_getPackLength(this);
- public CXCursor ParentFunctionOrMethod => clangsharp.Cursor_getParentFunctionOrMethod(this);
+ public readonly CXCursor ParentFunctionOrMethod => clangsharp.Cursor_getParentFunctionOrMethod(this);
- public CXComment ParsedComment => clang.Cursor_getParsedComment(this);
+ public readonly CXComment ParsedComment => clang.Cursor_getParsedComment(this);
- public CXCursor PlaceholderTypeConstraint => clangsharp.Cursor_getPlaceholderTypeConstraint(this);
+ public readonly CXCursor PlaceholderTypeConstraint => clangsharp.Cursor_getPlaceholderTypeConstraint(this);
- public CXCursor PreviousDecl => clangsharp.Cursor_getPreviousDecl(this);
+ public readonly CXCursor PreviousDecl => clangsharp.Cursor_getPreviousDecl(this);
- public CXCursor PrimaryTemplate => clangsharp.Cursor_getPrimaryTemplate(this);
+ public readonly CXCursor PrimaryTemplate => clangsharp.Cursor_getPrimaryTemplate(this);
- public CXPrintingPolicy PrintingPolicy => (kind != default) ? (CXPrintingPolicy)clang.getCursorPrintingPolicy(this) : default;
+ public readonly CXPrintingPolicy PrintingPolicy => (kind != default) ? (CXPrintingPolicy)clang.getCursorPrintingPolicy(this) : default;
- public CXString RawCommentText => clang.Cursor_getRawCommentText(this);
+ public readonly CXString RawCommentText => clang.Cursor_getRawCommentText(this);
- public CXType ReceiverType => !IsExpression ? default : clang.Cursor_getReceiverType(this);
+ public readonly CXType ReceiverType => !IsExpression ? default : clang.Cursor_getReceiverType(this);
- public CXCursor RedeclContext => clangsharp.Cursor_getRedeclContext(this);
+ public readonly CXCursor RedeclContext => clangsharp.Cursor_getRedeclContext(this);
- public CXCursor Referenced => clangsharp.Cursor_getReferenced(this);
+ public readonly CXCursor Referenced => clangsharp.Cursor_getReferenced(this);
- public bool RequiresZeroInitialization => clangsharp.Cursor_getRequiresZeroInitialization(this) != 0;
+ public readonly bool RequiresZeroInitialization => clangsharp.Cursor_getRequiresZeroInitialization(this) != 0;
- public int ResultIndex => clangsharp.Cursor_getResultIndex(this);
+ public readonly int ResultIndex => clangsharp.Cursor_getResultIndex(this);
- public CXType ResultType => clang.getCursorResultType(this);
+ public readonly CXType ResultType => clang.getCursorResultType(this);
- public CXType ReturnType => clangsharp.Cursor_getReturnType(this);
+ public readonly CXType ReturnType => clangsharp.Cursor_getReturnType(this);
- public CXCursor RhsExpr => clangsharp.Cursor_getRhsExpr(this);
+ public readonly CXCursor RhsExpr => clangsharp.Cursor_getRhsExpr(this);
- public CXCursor SemanticParent => clang.getCursorSemanticParent(this);
+ public readonly CXCursor SemanticParent => clang.getCursorSemanticParent(this);
- public bool ShouldCopy => clangsharp.Cursor_getShouldCopy(this) != 0;
+ public readonly bool ShouldCopy => clangsharp.Cursor_getShouldCopy(this) != 0;
- public CXSourceRange SourceRange => clangsharp.Cursor_getSourceRange(this);
+ public readonly CXSourceRange SourceRange => clangsharp.Cursor_getSourceRange(this);
- public CXSourceRange SourceRangeRaw => clangsharp.Cursor_getSourceRangeRaw(this);
+ public readonly CXSourceRange SourceRangeRaw => clangsharp.Cursor_getSourceRangeRaw(this);
- public CXCursor SpecializedCursorTemplate => clang.getSpecializedCursorTemplate(this);
+ public readonly CXCursor SpecializedCursorTemplate => clang.getSpecializedCursorTemplate(this);
- public CXString Spelling => clang.getCursorSpelling(this);
+ public readonly CXString Spelling => clang.getCursorSpelling(this);
- public CX_StmtClass StmtClass => clangsharp.Cursor_getStmtClass(this);
+ public readonly CX_StmtClass StmtClass => clangsharp.Cursor_getStmtClass(this);
- public string StmtClassSpelling
+ public readonly string StmtClassSpelling
{
get
{
@@ -1530,69 +1530,69 @@ public string StmtClassSpelling
}
}
- public CX_StorageClass StorageClass => clang.Cursor_getStorageClass(this);
+ public readonly CX_StorageClass StorageClass => clang.Cursor_getStorageClass(this);
- public CXString StringLiteralValue => clangsharp.Cursor_getStringLiteralValue(this);
+ public readonly CXString StringLiteralValue => clangsharp.Cursor_getStringLiteralValue(this);
- public CXCursor SubExpr => clangsharp.Cursor_getSubExpr(this);
+ public readonly CXCursor SubExpr => clangsharp.Cursor_getSubExpr(this);
- public CXCursor SubExprAsWritten => clangsharp.Cursor_getSubExprAsWritten(this);
+ public readonly CXCursor SubExprAsWritten => clangsharp.Cursor_getSubExprAsWritten(this);
- public CXCursor SubStmt => clangsharp.Cursor_getSubStmt(this);
+ public readonly CXCursor SubStmt => clangsharp.Cursor_getSubStmt(this);
- public CXCursor TargetUnionField => clangsharp.Cursor_getTargetUnionField(this);
+ public readonly CXCursor TargetUnionField => clangsharp.Cursor_getTargetUnionField(this);
- public CXCursorKind TemplateCursorKind => clang.getTemplateCursorKind(this);
+ public readonly CXCursorKind TemplateCursorKind => clang.getTemplateCursorKind(this);
- public CXCursor TemplatedDecl => clangsharp.Cursor_getTemplatedDecl(this);
+ public readonly CXCursor TemplatedDecl => clangsharp.Cursor_getTemplatedDecl(this);
- public CXCursor TemplateInstantiationPattern => clangsharp.Cursor_getTemplateInstantiationPattern(this);
+ public readonly CXCursor TemplateInstantiationPattern => clangsharp.Cursor_getTemplateInstantiationPattern(this);
- public CX_TemplateSpecializationKind TemplateSpecializationKind => clangsharp.Cursor_getTemplateSpecializationKind(this);
+ public readonly CX_TemplateSpecializationKind TemplateSpecializationKind => clangsharp.Cursor_getTemplateSpecializationKind(this);
- public int TemplateTypeParmDepth => clangsharp.Cursor_getTemplateTypeParmDepth(this);
+ public readonly int TemplateTypeParmDepth => clangsharp.Cursor_getTemplateTypeParmDepth(this);
- public int TemplateTypeParmIndex => clangsharp.Cursor_getTemplateTypeParmIndex(this);
+ public readonly int TemplateTypeParmIndex => clangsharp.Cursor_getTemplateTypeParmIndex(this);
- public int TemplateTypeParmPosition => clangsharp.Cursor_getTemplateTypeParmPosition(this);
+ public readonly int TemplateTypeParmPosition => clangsharp.Cursor_getTemplateTypeParmPosition(this);
- public CXType ThisObjectType => clangsharp.Cursor_getThisObjectType(this);
+ public readonly CXType ThisObjectType => clangsharp.Cursor_getThisObjectType(this);
- public CXType ThisType => clangsharp.Cursor_getThisType(this);
+ public readonly CXType ThisType => clangsharp.Cursor_getThisType(this);
- public CXTLSKind TlsKind => clang.getCursorTLSKind(this);
+ public readonly CXTLSKind TlsKind => clang.getCursorTLSKind(this);
- public CXCursor TrailingRequiresClause => clangsharp.Cursor_getTrailingRequiresClause(this);
+ public readonly CXCursor TrailingRequiresClause => clangsharp.Cursor_getTrailingRequiresClause(this);
- public CXTranslationUnit TranslationUnit => clang.Cursor_getTranslationUnit(this);
+ public readonly CXTranslationUnit TranslationUnit => clang.Cursor_getTranslationUnit(this);
- public CXType Type => clang.getCursorType(this);
+ public readonly CXType Type => clang.getCursorType(this);
- public CXType TypeOperand => clangsharp.Cursor_getTypeOperand(this);
+ public readonly CXType TypeOperand => clangsharp.Cursor_getTypeOperand(this);
- public CXType TypedefDeclUnderlyingType => clang.getTypedefDeclUnderlyingType(this);
+ public readonly CXType TypedefDeclUnderlyingType => clang.getTypedefDeclUnderlyingType(this);
- public CXCursor TypedefNameForAnonDecl => clangsharp.Cursor_getTypedefNameForAnonDecl(this);
+ public readonly CXCursor TypedefNameForAnonDecl => clangsharp.Cursor_getTypedefNameForAnonDecl(this);
- public CX_UnaryExprOrTypeTrait UnaryExprOrTypeTraitKind => clangsharp.Cursor_getUnaryExprOrTypeTraitKind(this);
+ public readonly CX_UnaryExprOrTypeTrait UnaryExprOrTypeTraitKind => clangsharp.Cursor_getUnaryExprOrTypeTraitKind(this);
- public CX_UnaryOperatorKind UnaryOperatorKind => clangsharp.Cursor_getUnaryOpcode(this);
+ public readonly CX_UnaryOperatorKind UnaryOperatorKind => clangsharp.Cursor_getUnaryOpcode(this);
- public CXString UnaryOperatorKindSpelling => clangsharp.Cursor_getUnaryOpcodeSpelling(UnaryOperatorKind);
+ public readonly CXString UnaryOperatorKindSpelling => clangsharp.Cursor_getUnaryOpcodeSpelling(UnaryOperatorKind);
- public CXCursor UnderlyingDecl => clangsharp.Cursor_getUnderlyingDecl(this);
+ public readonly CXCursor UnderlyingDecl => clangsharp.Cursor_getUnderlyingDecl(this);
- public CXCursor UninstantiatedDefaultArg => clangsharp.Cursor_getUninstantiatedDefaultArg(this);
+ public readonly CXCursor UninstantiatedDefaultArg => clangsharp.Cursor_getUninstantiatedDefaultArg(this);
- public CXCursor UsedContext => clangsharp.Cursor_getUsedContext(this);
+ public readonly CXCursor UsedContext => clangsharp.Cursor_getUsedContext(this);
- public CXString Usr => clang.getCursorUSR(this);
+ public readonly CXString Usr => clang.getCursorUSR(this);
- public CXVisibilityKind Visibility => clang.getCursorVisibility(this);
+ public readonly CXVisibilityKind Visibility => clang.getCursorVisibility(this);
- public long VtblIdx => clangsharp.Cursor_getVtblIdx(this);
+ public readonly long VtblIdx => clangsharp.Cursor_getVtblIdx(this);
- internal string DebuggerDisplayString
+ internal readonly string DebuggerDisplayString
{
get
{
@@ -1634,7 +1634,7 @@ internal string DebuggerDisplayString
public static bool operator !=(CXCursor left, CXCursor right) => clang.equalCursors(left, right) == 0;
- public bool CapturesVariable(CXCursor var) => clangsharp.Cursor_getCapturesVariable(this, var) != 0;
+ public readonly bool CapturesVariable(CXCursor var) => clangsharp.Cursor_getCapturesVariable(this, var) != 0;
public static void DisposeOverriddenCursors(ReadOnlySpan overridden)
{
@@ -1644,47 +1644,47 @@ public static void DisposeOverriddenCursors(ReadOnlySpan overridden)
}
}
- public override bool Equals(object? obj) => (obj is CXCursor other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXCursor other) && Equals(other);
- public bool Equals(CXCursor other) => this == other;
+ public readonly bool Equals(CXCursor other) => this == other;
- public CXResult FindReferencesInFile(CXFile file, CXCursorAndRangeVisitor visitor) => clang.findReferencesInFile(this, file, visitor);
+ public readonly CXResult FindReferencesInFile(CXFile file, CXCursorAndRangeVisitor visitor) => clang.findReferencesInFile(this, file, visitor);
- public CXCursor GetAssociatedConstraint(uint index) => clangsharp.Cursor_getAssociatedConstraint(this, index);
+ public readonly CXCursor GetAssociatedConstraint(uint index) => clangsharp.Cursor_getAssociatedConstraint(this, index);
- public CXCursor GetArgument(uint index) => clangsharp.Cursor_getArgument(this, index);
+ public readonly CXCursor GetArgument(uint index) => clangsharp.Cursor_getArgument(this, index);
- public CXCursor GetAttr(uint index) => clangsharp.Cursor_getAttr(this, index);
+ public readonly CXCursor GetAttr(uint index) => clangsharp.Cursor_getAttr(this, index);
- public CXCursor GetBase(uint index) => clangsharp.Cursor_getBase(this, index);
+ public readonly CXCursor GetBase(uint index) => clangsharp.Cursor_getBase(this, index);
- public CXCursor GetBindingDecl(uint index) => clangsharp.Cursor_getBindingDecl(this, index);
+ public readonly CXCursor GetBindingDecl(uint index) => clangsharp.Cursor_getBindingDecl(this, index);
- public CXCursor GetCtor(uint index) => clangsharp.Cursor_getCtor(this, index);
+ public readonly CXCursor GetCtor(uint index) => clangsharp.Cursor_getCtor(this, index);
- public CXCursor GetCaptureCopyExpr(uint index) => clangsharp.Cursor_getCaptureCopyExpr(this, index);
+ public readonly CXCursor GetCaptureCopyExpr(uint index) => clangsharp.Cursor_getCaptureCopyExpr(this, index);
- public CXCursor GetCapturedVar(uint index) => clangsharp.Cursor_getCapturedVar(this, index);
+ public readonly CXCursor GetCapturedVar(uint index) => clangsharp.Cursor_getCapturedVar(this, index);
- public CX_VariableCaptureKind GetCaptureKind(uint index) => clangsharp.Cursor_getCaptureKind(this, index);
+ public readonly CX_VariableCaptureKind GetCaptureKind(uint index) => clangsharp.Cursor_getCaptureKind(this, index);
- public bool GetCaptureHasCopyExpr(uint index) => clangsharp.Cursor_getCaptureHasCopyExpr(this, index) != 0;
+ public readonly bool GetCaptureHasCopyExpr(uint index) => clangsharp.Cursor_getCaptureHasCopyExpr(this, index) != 0;
- public bool GetCaptureIsByRef(uint index) => clangsharp.Cursor_getCaptureIsByRef(this, index) != 0;
+ public readonly bool GetCaptureIsByRef(uint index) => clangsharp.Cursor_getCaptureIsByRef(this, index) != 0;
- public bool GetCaptureIsEscapingByRef(uint index) => clangsharp.Cursor_getCaptureIsEscapingByRef(this, index) != 0;
+ public readonly bool GetCaptureIsEscapingByRef(uint index) => clangsharp.Cursor_getCaptureIsEscapingByRef(this, index) != 0;
- public bool GetCaptureIsNested(uint index) => clangsharp.Cursor_getCaptureIsNested(this, index) != 0;
+ public readonly bool GetCaptureIsNested(uint index) => clangsharp.Cursor_getCaptureIsNested(this, index) != 0;
- public bool GetCaptureIsNonEscapingByRef(uint index) => clangsharp.Cursor_getCaptureIsNonEscapingByRef(this, index) != 0;
+ public readonly bool GetCaptureIsNonEscapingByRef(uint index) => clangsharp.Cursor_getCaptureIsNonEscapingByRef(this, index) != 0;
- public CXCursor GetCaptureVariable(uint index) => clangsharp.Cursor_getCaptureVariable(this, index);
+ public readonly CXCursor GetCaptureVariable(uint index) => clangsharp.Cursor_getCaptureVariable(this, index);
- public CXCursor GetChild(uint index) => clangsharp.Cursor_getChild(this, index);
+ public readonly CXCursor GetChild(uint index) => clangsharp.Cursor_getChild(this, index);
- public CXCursor GetDecl(uint index) => clangsharp.Cursor_getDecl(this, index);
+ public readonly CXCursor GetDecl(uint index) => clangsharp.Cursor_getDecl(this, index);
- public void GetDefinitionSpellingAndExtent(out string spelling, out uint startLine, out uint startColumn, out uint endLine, out uint endColumn)
+ public readonly void GetDefinitionSpellingAndExtent(out string spelling, out uint startLine, out uint startColumn, out uint endLine, out uint endColumn)
{
fixed (uint* pStartLine = &startLine)
fixed (uint* pStartColumn = &startColumn)
@@ -1698,19 +1698,19 @@ public void GetDefinitionSpellingAndExtent(out string spelling, out uint startLi
}
}
- public CXCursor GetEnumerator(uint index) => clangsharp.Cursor_getEnumerator(this, index);
+ public readonly CXCursor GetEnumerator(uint index) => clangsharp.Cursor_getEnumerator(this, index);
- public CXType GetExpansionType(uint index) => clangsharp.Cursor_getExpansionType(this, index);
+ public readonly CXType GetExpansionType(uint index) => clangsharp.Cursor_getExpansionType(this, index);
- public CXCursor GetExpr(uint index) => clangsharp.Cursor_getExpr(this, index);
+ public readonly CXCursor GetExpr(uint index) => clangsharp.Cursor_getExpr(this, index);
- public CXCursor GetField(uint index) => clangsharp.Cursor_getField(this, index);
+ public readonly CXCursor GetField(uint index) => clangsharp.Cursor_getField(this, index);
- public CXCursor GetFriend(uint index) => clangsharp.Cursor_getFriend(this, index);
+ public readonly CXCursor GetFriend(uint index) => clangsharp.Cursor_getFriend(this, index);
- public override int GetHashCode() => (int)Hash;
+ public override readonly int GetHashCode() => (int)Hash;
- public bool GetIsExternalSymbol(out CXString language, out CXString definedIn, out bool isGenerated)
+ public readonly bool GetIsExternalSymbol(out CXString language, out CXString definedIn, out bool isGenerated)
{
fixed (CXString* pLanguage = &language)
fixed (CXString* pDefinedIn = &definedIn)
@@ -1722,15 +1722,15 @@ public bool GetIsExternalSymbol(out CXString language, out CXString definedIn, o
}
}
- public CXCursor GetMethod(uint index) => clangsharp.Cursor_getMethod(this, index);
+ public readonly CXCursor GetMethod(uint index) => clangsharp.Cursor_getMethod(this, index);
- public int GetNumTemplateParameters(uint listIndex) => clangsharp.Cursor_getNumTemplateParameters(this, listIndex);
+ public readonly int GetNumTemplateParameters(uint listIndex) => clangsharp.Cursor_getNumTemplateParameters(this, listIndex);
- public CXObjCPropertyAttrKind GetObjCPropertyAttributes(uint reserved) => (CXObjCPropertyAttrKind)clang.Cursor_getObjCPropertyAttributes(this, reserved);
+ public readonly CXObjCPropertyAttrKind GetObjCPropertyAttributes(uint reserved) => (CXObjCPropertyAttrKind)clang.Cursor_getObjCPropertyAttributes(this, reserved);
- public CXCursor GetOverloadedDecl(uint index) => clang.getOverloadedDecl(this, index);
+ public readonly CXCursor GetOverloadedDecl(uint index) => clang.getOverloadedDecl(this, index);
- public int GetPlatformAvailability(out bool alwaysDeprecated, out CXString deprecatedMessage, out bool alwaysUnavailable, out CXString unavailableMessage, Span availability)
+ public readonly int GetPlatformAvailability(out bool alwaysDeprecated, out CXString deprecatedMessage, out bool alwaysUnavailable, out CXString unavailableMessage, Span availability)
{
fixed (CXString* pDeprecatedMessage = &deprecatedMessage)
fixed (CXString* pUnavailableMessage = &unavailableMessage)
@@ -1745,35 +1745,35 @@ public int GetPlatformAvailability(out bool alwaysDeprecated, out CXString depre
}
}
- public CXString GetPrettyPrinted(CXPrintingPolicy policy) => clang.getCursorPrettyPrinted(this, policy);
+ public readonly CXString GetPrettyPrinted(CXPrintingPolicy policy) => clang.getCursorPrettyPrinted(this, policy);
- public CXCursor GetProtocol(uint index) => clangsharp.Cursor_getProtocol(this, index);
+ public readonly CXCursor GetProtocol(uint index) => clangsharp.Cursor_getProtocol(this, index);
- public CXSourceRange GetReferenceNameRange(CXNameRefFlags nameFlags, uint pieceIndex) => clang.getCursorReferenceNameRange(this, (uint)nameFlags, pieceIndex);
+ public readonly CXSourceRange GetReferenceNameRange(CXNameRefFlags nameFlags, uint pieceIndex) => clang.getCursorReferenceNameRange(this, (uint)nameFlags, pieceIndex);
- public CXCursor GetSpecialization(uint index) => clangsharp.Cursor_getSpecialization(this, index);
+ public readonly CXCursor GetSpecialization(uint index) => clangsharp.Cursor_getSpecialization(this, index);
- public CXSourceRange GetSpellingNameRange(uint pieceIndex, uint options) => clang.Cursor_getSpellingNameRange(this, pieceIndex, options);
+ public readonly CXSourceRange GetSpellingNameRange(uint pieceIndex, uint options) => clang.Cursor_getSpellingNameRange(this, pieceIndex, options);
- public CXCursor GetSubDecl(uint i) => clangsharp.Cursor_getSubDecl(this, i);
+ public readonly CXCursor GetSubDecl(uint i) => clangsharp.Cursor_getSubDecl(this, i);
- public CX_TemplateArgument GetTemplateArgument(uint index) => clangsharp.Cursor_getTemplateArgument(this, index);
+ public readonly CX_TemplateArgument GetTemplateArgument(uint index) => clangsharp.Cursor_getTemplateArgument(this, index);
- public CX_TemplateArgumentLoc GetTemplateArgumentLoc(uint index) => clangsharp.Cursor_getTemplateArgumentLoc(this, index);
+ public readonly CX_TemplateArgumentLoc GetTemplateArgumentLoc(uint index) => clangsharp.Cursor_getTemplateArgumentLoc(this, index);
- public CXCursor GetTemplateParameter(uint listIndex, uint parameterIndex) => clangsharp.Cursor_getTemplateParameter(this, listIndex, parameterIndex);
+ public readonly CXCursor GetTemplateParameter(uint listIndex, uint parameterIndex) => clangsharp.Cursor_getTemplateParameter(this, listIndex, parameterIndex);
- public CXType GetTemplateArgumentType(uint i) => clang.Cursor_getTemplateArgumentType(this, i);
+ public readonly CXType GetTemplateArgumentType(uint i) => clang.Cursor_getTemplateArgumentType(this, i);
- public ulong GetTemplateArgumentUnsignedValue(uint i) => clang.Cursor_getTemplateArgumentUnsignedValue(this, i);
+ public readonly ulong GetTemplateArgumentUnsignedValue(uint i) => clang.Cursor_getTemplateArgumentUnsignedValue(this, i);
- public long GetTemplateArgumentValue(uint i) => clang.Cursor_getTemplateArgumentValue(this, i);
+ public readonly long GetTemplateArgumentValue(uint i) => clang.Cursor_getTemplateArgumentValue(this, i);
- public CXCursor GetVBase(uint index) => clangsharp.Cursor_getVBase(this, index);
+ public readonly CXCursor GetVBase(uint index) => clangsharp.Cursor_getVBase(this, index);
- public override string ToString() => Spelling.ToString();
+ public override readonly string ToString() => Spelling.ToString();
- public CXChildVisitResult VisitChildren(CXCursorVisitor visitor, CXClientData clientData)
+ public readonly CXChildVisitResult VisitChildren(CXCursorVisitor visitor, CXClientData clientData)
{
var pVisitor = (delegate* unmanaged[Cdecl])Marshal.GetFunctionPointerForDelegate(visitor);
var result = VisitChildren(pVisitor, clientData);
@@ -1782,7 +1782,7 @@ public CXChildVisitResult VisitChildren(CXCursorVisitor visitor, CXClientData cl
return result;
}
- public CXChildVisitResult VisitChildren(delegate* unmanaged[Cdecl] visitor, CXClientData clientData)
+ public readonly CXChildVisitResult VisitChildren(delegate* unmanaged[Cdecl] visitor, CXClientData clientData)
{
return (CXChildVisitResult)clang.visitChildren(this, visitor, clientData);
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXCursorSet.cs b/sources/ClangSharp.Interop/Extensions/CXCursorSet.cs
index f6f76b9c..1de69061 100644
--- a/sources/ClangSharp.Interop/Extensions/CXCursorSet.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXCursorSet.cs
@@ -23,7 +23,7 @@ public CXCursorSet(IntPtr handle)
public static CXCursorSet Create() => clang.createCXCursorSet();
- public bool Contains(CXCursor cursor) => clang.CXCursorSet_contains(this, cursor) != 0;
+ public readonly bool Contains(CXCursor cursor) => clang.CXCursorSet_contains(this, cursor) != 0;
public void Dispose()
{
@@ -34,11 +34,11 @@ public void Dispose()
}
}
- public override bool Equals(object? obj) => (obj is CXCursorSet other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXCursorSet other) && Equals(other);
- public bool Equals(CXCursorSet other) => this == other;
+ public readonly bool Equals(CXCursorSet other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public bool Insert(CXCursor cursor) => clang.CXCursorSet_insert(this, cursor) != 0;
+ public readonly bool Insert(CXCursor cursor) => clang.CXCursorSet_insert(this, cursor) != 0;
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXDiagnostic.cs b/sources/ClangSharp.Interop/Extensions/CXDiagnostic.cs
index e981b7bf..70ace825 100644
--- a/sources/ClangSharp.Interop/Extensions/CXDiagnostic.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXDiagnostic.cs
@@ -13,23 +13,23 @@ public CXDiagnostic(IntPtr handle)
public static CXDiagnosticDisplayOptions DefaultDisplayOptions => (CXDiagnosticDisplayOptions)clang.defaultDiagnosticDisplayOptions();
- public uint Category => clang.getDiagnosticCategory(this);
+ public readonly uint Category => clang.getDiagnosticCategory(this);
- public CXString CategoryText => clang.getDiagnosticCategoryText(this);
+ public readonly CXString CategoryText => clang.getDiagnosticCategoryText(this);
- public CXDiagnosticSet ChildDiagnostics => (CXDiagnosticSet)clang.getChildDiagnostics(this);
+ public readonly CXDiagnosticSet ChildDiagnostics => (CXDiagnosticSet)clang.getChildDiagnostics(this);
public IntPtr Handle { get; set; }
- public CXSourceLocation Location => clang.getDiagnosticLocation(this);
+ public readonly CXSourceLocation Location => clang.getDiagnosticLocation(this);
- public uint NumFixIts => clang.getDiagnosticNumFixIts(this);
+ public readonly uint NumFixIts => clang.getDiagnosticNumFixIts(this);
- public uint NumRanges => clang.getDiagnosticNumRanges(this);
+ public readonly uint NumRanges => clang.getDiagnosticNumRanges(this);
- public CXDiagnosticSeverity Severity => clang.getDiagnosticSeverity(this);
+ public readonly CXDiagnosticSeverity Severity => clang.getDiagnosticSeverity(this);
- public CXString Spelling => clang.getDiagnosticSpelling(this);
+ public readonly CXString Spelling => clang.getDiagnosticSpelling(this);
public static explicit operator CXDiagnostic(void* value) => new CXDiagnostic((IntPtr)value);
@@ -48,16 +48,16 @@ public void Dispose()
}
}
- public override bool Equals(object? obj) => (obj is CXDiagnostic other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXDiagnostic other) && Equals(other);
- public bool Equals(CXDiagnostic other) => this == other;
+ public readonly bool Equals(CXDiagnostic other) => this == other;
- public CXString Format(CXDiagnosticDisplayOptions options) => clang.formatDiagnostic(this, (uint)options);
+ public readonly CXString Format(CXDiagnosticDisplayOptions options) => clang.formatDiagnostic(this, (uint)options);
[Obsolete("Use " + nameof(CategoryText) + " instead.")]
public static CXString GetCategoryName(uint category) => clang.getDiagnosticCategoryName(category);
- public CXString GetFixIt(uint fixIt, out CXSourceRange replacementRange)
+ public readonly CXString GetFixIt(uint fixIt, out CXSourceRange replacementRange)
{
fixed (CXSourceRange* pReplacementRange = &replacementRange)
{
@@ -65,9 +65,9 @@ public CXString GetFixIt(uint fixIt, out CXSourceRange replacementRange)
}
}
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public CXString GetOption(out CXString disable)
+ public readonly CXString GetOption(out CXString disable)
{
fixed (CXString* pDisable = &disable)
{
@@ -75,7 +75,7 @@ public CXString GetOption(out CXString disable)
}
}
- public CXSourceRange GetRange(uint range) => clang.getDiagnosticRange(this, range);
+ public readonly CXSourceRange GetRange(uint range) => clang.getDiagnosticRange(this, range);
- public override string ToString() => Spelling.ToString();
+ public override readonly string ToString() => Spelling.ToString();
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXDiagnosticSet.cs b/sources/ClangSharp.Interop/Extensions/CXDiagnosticSet.cs
index ba2df4ff..5d7b0775 100644
--- a/sources/ClangSharp.Interop/Extensions/CXDiagnosticSet.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXDiagnosticSet.cs
@@ -24,13 +24,13 @@ public CXDiagnosticSet(IntPtr handle)
Handle = handle;
}
- public CXDiagnostic this[uint index] => GetDiagnostic(index);
+ public readonly CXDiagnostic this[uint index] => GetDiagnostic(index);
- public int Count => (int)NumDiagnostics;
+ public readonly int Count => (int)NumDiagnostics;
public IntPtr Handle { get; set; }
- public uint NumDiagnostics => clang.getNumDiagnosticsInSet(this);
+ public readonly uint NumDiagnostics => clang.getNumDiagnosticsInSet(this);
public static explicit operator CXDiagnosticSet(void* value) => new CXDiagnosticSet((IntPtr)value);
@@ -49,13 +49,13 @@ public void Dispose()
}
}
- public override bool Equals(object? obj) => (obj is CXDiagnosticSet other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXDiagnosticSet other) && Equals(other);
- public bool Equals(CXDiagnosticSet other) => this == other;
+ public readonly bool Equals(CXDiagnosticSet other) => this == other;
- public CXDiagnostic GetDiagnostic(uint index) => (CXDiagnostic)clang.getDiagnosticInSet(this, index);
+ public readonly CXDiagnostic GetDiagnostic(uint index) => (CXDiagnostic)clang.getDiagnosticInSet(this, index);
- public IEnumerator GetEnumerator()
+ public readonly IEnumerator GetEnumerator()
{
var count = NumDiagnostics;
@@ -65,7 +65,7 @@ public IEnumerator GetEnumerator()
}
}
- IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
+ readonly IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXEvalResult.cs b/sources/ClangSharp.Interop/Extensions/CXEvalResult.cs
index c4d1f55a..3660c27b 100644
--- a/sources/ClangSharp.Interop/Extensions/CXEvalResult.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXEvalResult.cs
@@ -12,13 +12,13 @@ public CXEvalResult(IntPtr handle)
Handle = handle;
}
- public double AsDouble => (Kind == CXEval_Float) ? clang.EvalResult_getAsDouble(this) : 0;
+ public readonly double AsDouble => (Kind == CXEval_Float) ? clang.EvalResult_getAsDouble(this) : 0;
- public int AsInt => (Kind == CXEval_Int) ? clang.EvalResult_getAsInt(this) : 0;
+ public readonly int AsInt => (Kind == CXEval_Int) ? clang.EvalResult_getAsInt(this) : 0;
- public long AsLongLong => (Kind == CXEval_Int) ? clang.EvalResult_getAsLongLong(this) : 0;
+ public readonly long AsLongLong => (Kind == CXEval_Int) ? clang.EvalResult_getAsLongLong(this) : 0;
- public string AsStr
+ public readonly string AsStr
{
get
{
@@ -33,13 +33,13 @@ public string AsStr
}
}
- public ulong AsUnsigned => (Kind == CXEval_Int) ? clang.EvalResult_getAsUnsigned(this) : 0;
+ public readonly ulong AsUnsigned => (Kind == CXEval_Int) ? clang.EvalResult_getAsUnsigned(this) : 0;
public IntPtr Handle { get; set; }
- public bool IsUnsignedInt => (Kind == CXEval_Int) && (clang.EvalResult_isUnsignedInt(this) != 0);
+ public readonly bool IsUnsignedInt => (Kind == CXEval_Int) && (clang.EvalResult_isUnsignedInt(this) != 0);
- public CXEvalResultKind Kind => clang.EvalResult_getKind(this);
+ public readonly CXEvalResultKind Kind => clang.EvalResult_getKind(this);
public static explicit operator CXEvalResult(void* value) => new CXEvalResult((IntPtr)value);
@@ -58,9 +58,9 @@ public void Dispose()
}
}
- public override bool Equals(object? obj) => (obj is CXEvalResult other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXEvalResult other) && Equals(other);
- public bool Equals(CXEvalResult other) => this == other;
+ public readonly bool Equals(CXEvalResult other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXFile.cs b/sources/ClangSharp.Interop/Extensions/CXFile.cs
index e6039773..2a829da2 100644
--- a/sources/ClangSharp.Interop/Extensions/CXFile.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXFile.cs
@@ -13,9 +13,9 @@ public CXFile(IntPtr handle)
public IntPtr Handle { get; set; }
- public CXString Name => clang.getFileName(this);
+ public readonly CXString Name => clang.getFileName(this);
- public long Time => clang.getFileTime(this);
+ public readonly long Time => clang.getFileTime(this);
public static explicit operator CXFile(void* value) => new CXFile((IntPtr)value);
@@ -25,15 +25,15 @@ public CXFile(IntPtr handle)
public static bool operator !=(CXFile left, CXFile right) => clang.File_isEqual(left, right) == 0;
- public override bool Equals(object? obj) => (obj is CXFile other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXFile other) && Equals(other);
- public bool Equals(CXFile other) => this == other;
+ public readonly bool Equals(CXFile other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public override string ToString() => Name.ToString();
+ public override readonly string ToString() => Name.ToString();
- public bool TryGetUniqueId(out CXFileUniqueID id)
+ public readonly bool TryGetUniqueId(out CXFileUniqueID id)
{
fixed (CXFileUniqueID* pId = &id)
{
@@ -41,5 +41,5 @@ public bool TryGetUniqueId(out CXFileUniqueID id)
}
}
- public CXString TryGetRealPathName() => clang.File_tryGetRealPathName(this);
+ public readonly CXString TryGetRealPathName() => clang.File_tryGetRealPathName(this);
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXIdxClientASTFile.cs b/sources/ClangSharp.Interop/Extensions/CXIdxClientASTFile.cs
index 2280b3b7..b951af6e 100644
--- a/sources/ClangSharp.Interop/Extensions/CXIdxClientASTFile.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXIdxClientASTFile.cs
@@ -21,9 +21,9 @@ public CXIdxClientASTFile(IntPtr handle)
public static bool operator !=(CXIdxClientASTFile left, CXIdxClientASTFile right) => left.Handle != right.Handle;
- public override bool Equals(object? obj) => (obj is CXIdxClientASTFile other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXIdxClientASTFile other) && Equals(other);
- public bool Equals(CXIdxClientASTFile other) => this == other;
+ public readonly bool Equals(CXIdxClientASTFile other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXIdxClientContainer.cs b/sources/ClangSharp.Interop/Extensions/CXIdxClientContainer.cs
index d06146a9..65a95e5c 100644
--- a/sources/ClangSharp.Interop/Extensions/CXIdxClientContainer.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXIdxClientContainer.cs
@@ -21,9 +21,9 @@ public CXIdxClientContainer(IntPtr handle)
public static bool operator !=(CXIdxClientContainer left, CXIdxClientContainer right) => left.Handle != right.Handle;
- public override bool Equals(object? obj) => (obj is CXIdxClientContainer other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXIdxClientContainer other) && Equals(other);
- public bool Equals(CXIdxClientContainer other) => this == other;
+ public readonly bool Equals(CXIdxClientContainer other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXIdxClientEntity.cs b/sources/ClangSharp.Interop/Extensions/CXIdxClientEntity.cs
index 10e6278b..8073dd9e 100644
--- a/sources/ClangSharp.Interop/Extensions/CXIdxClientEntity.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXIdxClientEntity.cs
@@ -21,9 +21,9 @@ public CXIdxClientEntity(IntPtr handle)
public static bool operator !=(CXIdxClientEntity left, CXIdxClientEntity right) => left.Handle != right.Handle;
- public override bool Equals(object? obj) => (obj is CXIdxClientEntity other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXIdxClientEntity other) && Equals(other);
- public bool Equals(CXIdxClientEntity other) => this == other;
+ public readonly bool Equals(CXIdxClientEntity other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXIdxClientFile.cs b/sources/ClangSharp.Interop/Extensions/CXIdxClientFile.cs
index 77af0e53..c9be23c0 100644
--- a/sources/ClangSharp.Interop/Extensions/CXIdxClientFile.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXIdxClientFile.cs
@@ -21,9 +21,9 @@ public CXIdxClientFile(IntPtr handle)
public static bool operator !=(CXIdxClientFile left, CXIdxClientFile right) => left.Handle != right.Handle;
- public override bool Equals(object? obj) => (obj is CXIdxClientFile other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXIdxClientFile other) && Equals(other);
- public bool Equals(CXIdxClientFile other) => this == other;
+ public readonly bool Equals(CXIdxClientFile other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXIdxEntityInfo.cs b/sources/ClangSharp.Interop/Extensions/CXIdxEntityInfo.cs
index 5f1c50fc..7161d5a0 100644
--- a/sources/ClangSharp.Interop/Extensions/CXIdxEntityInfo.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXIdxEntityInfo.cs
@@ -23,5 +23,5 @@ public CXIdxClientEntity ClientEntity
}
}
- public bool IsObjCContainer => clang.index_isEntityObjCContainerKind(kind) != 0;
+ public readonly bool IsObjCContainer => clang.index_isEntityObjCContainerKind(kind) != 0;
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXIdxLoc.cs b/sources/ClangSharp.Interop/Extensions/CXIdxLoc.cs
index 76aa7bd0..a431282f 100644
--- a/sources/ClangSharp.Interop/Extensions/CXIdxLoc.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXIdxLoc.cs
@@ -4,9 +4,9 @@ namespace ClangSharp.Interop;
public unsafe partial struct CXIdxLoc
{
- public CXSourceLocation SourceLocation => clang.indexLoc_getCXSourceLocation(this);
+ public readonly CXSourceLocation SourceLocation => clang.indexLoc_getCXSourceLocation(this);
- public void GetFileLocation(out CXIdxClientFile indexFile, out CXFile file, out uint line, out uint column, out uint offset)
+ public readonly void GetFileLocation(out CXIdxClientFile indexFile, out CXFile file, out uint line, out uint column, out uint offset)
{
fixed (CXIdxClientFile* pIndexFile = &indexFile)
fixed (CXFile* pFile = &file)
diff --git a/sources/ClangSharp.Interop/Extensions/CXIndex.cs b/sources/ClangSharp.Interop/Extensions/CXIndex.cs
index 6f23926e..249ea679 100644
--- a/sources/ClangSharp.Interop/Extensions/CXIndex.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXIndex.cs
@@ -11,7 +11,7 @@ public CXIndex(IntPtr handle)
Handle = handle;
}
- public CXGlobalOptFlags GlobalOptions
+ public readonly CXGlobalOptFlags GlobalOptions
{
get
{
@@ -36,15 +36,15 @@ public CXGlobalOptFlags GlobalOptions
public static CXIndex Create(bool excludeDeclarationsFromPch = false, bool displayDiagnostics = false) => (CXIndex)clang.createIndex(excludeDeclarationsFromPch ? 1 : 0, displayDiagnostics ? 1 : 0);
- public void Dispose() => clang.disposeIndex(this);
+ public readonly void Dispose() => clang.disposeIndex(this);
- public override bool Equals(object? obj) => (obj is CXIndex other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXIndex other) && Equals(other);
- public bool Equals(CXIndex other) => this == other;
+ public readonly bool Equals(CXIndex other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public void SetInvocationEmissionPathOption(string Path)
+ public readonly void SetInvocationEmissionPathOption(string Path)
{
using var marshaledPath = new MarshaledString(Path);
clang.CXIndex_setInvocationEmissionPathOption(this, marshaledPath);
diff --git a/sources/ClangSharp.Interop/Extensions/CXIndexAction.cs b/sources/ClangSharp.Interop/Extensions/CXIndexAction.cs
index 75e6fa98..7f24dc25 100644
--- a/sources/ClangSharp.Interop/Extensions/CXIndexAction.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXIndexAction.cs
@@ -32,13 +32,13 @@ public void Dispose()
}
}
- public override bool Equals(object? obj) => (obj is CXIndexAction other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXIndexAction other) && Equals(other);
- public bool Equals(CXIndexAction other) => this == other;
+ public readonly bool Equals(CXIndexAction other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public bool TryIndexSourceFile(CXClientData clientData, ReadOnlySpan indexCallbacks, CXIndexOptFlags indexOptions, string sourceFilename, ReadOnlySpan commandLineArgs, ReadOnlySpan unsavedFiles, out CXTranslationUnit tu, CXTranslationUnit_Flags tuOptions)
+ public readonly bool TryIndexSourceFile(CXClientData clientData, ReadOnlySpan indexCallbacks, CXIndexOptFlags indexOptions, string sourceFilename, ReadOnlySpan commandLineArgs, ReadOnlySpan unsavedFiles, out CXTranslationUnit tu, CXTranslationUnit_Flags tuOptions)
{
using var marshaledSourceFilename = new MarshaledString(sourceFilename);
using var marshaledCommandLineArgs = new MarshaledStringArray(commandLineArgs);
@@ -53,7 +53,7 @@ public bool TryIndexSourceFile(CXClientData clientData, ReadOnlySpan indexCallbacks, CXIndexOptFlags indexOptions, string sourceFilename, ReadOnlySpan commandLineArgs, ReadOnlySpan unsavedFiles, out CXTranslationUnit tu, CXTranslationUnit_Flags tuOptions)
+ public readonly bool TryIndexSourceFileFullArgv(CXClientData clientData, ReadOnlySpan indexCallbacks, CXIndexOptFlags indexOptions, string sourceFilename, ReadOnlySpan commandLineArgs, ReadOnlySpan unsavedFiles, out CXTranslationUnit tu, CXTranslationUnit_Flags tuOptions)
{
using var marshaledSourceFilename = new MarshaledString(sourceFilename);
using var marshaledCommandLineArgs = new MarshaledStringArray(commandLineArgs);
@@ -68,7 +68,7 @@ public bool TryIndexSourceFileFullArgv(CXClientData clientData, ReadOnlySpan indexCallbacks, CXIndexOptFlags indexOptions, CXTranslationUnit tu)
+ public readonly bool TryIndexTranslationUnit(CXClientData clientData, ReadOnlySpan indexCallbacks, CXIndexOptFlags indexOptions, CXTranslationUnit tu)
{
fixed (IndexerCallbacks* pIndexCallbacks = indexCallbacks)
{
diff --git a/sources/ClangSharp.Interop/Extensions/CXModule.cs b/sources/ClangSharp.Interop/Extensions/CXModule.cs
index 1b2f8925..0cc087dc 100644
--- a/sources/ClangSharp.Interop/Extensions/CXModule.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXModule.cs
@@ -11,17 +11,17 @@ public CXModule(IntPtr handle)
Handle = handle;
}
- public CXFile AstFile => (CXFile)clang.Module_getASTFile(this);
+ public readonly CXFile AstFile => (CXFile)clang.Module_getASTFile(this);
- public CXString FullName => clang.Module_getFullName(this);
+ public readonly CXString FullName => clang.Module_getFullName(this);
public IntPtr Handle { get; set; }
- public bool IsSystem => clang.Module_isSystem(this) != 0;
+ public readonly bool IsSystem => clang.Module_isSystem(this) != 0;
- public CXString Name => clang.Module_getName(this);
+ public readonly CXString Name => clang.Module_getName(this);
- public CXModule Parent => (CXModule)clang.Module_getParent(this);
+ public readonly CXModule Parent => (CXModule)clang.Module_getParent(this);
public static explicit operator CXModule(void* value) => new CXModule((IntPtr)value);
@@ -31,15 +31,15 @@ public CXModule(IntPtr handle)
public static bool operator !=(CXModule left, CXModule right) => left.Handle != right.Handle;
- public override bool Equals(object? obj) => (obj is CXModule other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXModule other) && Equals(other);
- public bool Equals(CXModule other) => this == other;
+ public readonly bool Equals(CXModule other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public uint GetNumTopLevelHeaders(CXTranslationUnit translationUnit) => clang.Module_getNumTopLevelHeaders(translationUnit, this);
+ public readonly uint GetNumTopLevelHeaders(CXTranslationUnit translationUnit) => clang.Module_getNumTopLevelHeaders(translationUnit, this);
- public CXFile GetTopLevelHeader(CXTranslationUnit translationUnit, uint index) => (CXFile)clang.Module_getTopLevelHeader(translationUnit, this, index);
+ public readonly CXFile GetTopLevelHeader(CXTranslationUnit translationUnit, uint index) => (CXFile)clang.Module_getTopLevelHeader(translationUnit, this, index);
- public override string ToString() => FullName.ToString();
+ public override readonly string ToString() => FullName.ToString();
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXModuleMapDescriptor.cs b/sources/ClangSharp.Interop/Extensions/CXModuleMapDescriptor.cs
index bea305e2..2531311d 100644
--- a/sources/ClangSharp.Interop/Extensions/CXModuleMapDescriptor.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXModuleMapDescriptor.cs
@@ -32,25 +32,25 @@ public void Dispose()
}
}
- public override bool Equals(object? obj) => (obj is CXModuleMapDescriptor other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXModuleMapDescriptor other) && Equals(other);
- public bool Equals(CXModuleMapDescriptor other) => this == other;
+ public readonly bool Equals(CXModuleMapDescriptor other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public CXErrorCode SetFrameworkModuleName(string name)
+ public readonly CXErrorCode SetFrameworkModuleName(string name)
{
var marshaledName = new MarshaledString(name);
return clang.ModuleMapDescriptor_setFrameworkModuleName(this, marshaledName);
}
- public CXErrorCode SetUmbrellaHeader(string name)
+ public readonly CXErrorCode SetUmbrellaHeader(string name)
{
using var marshaledName = new MarshaledString(name);
return clang.ModuleMapDescriptor_setUmbrellaHeader(this, marshaledName);
}
- public Span WriteToBuffer(uint options, out CXErrorCode errorCode)
+ public readonly Span WriteToBuffer(uint options, out CXErrorCode errorCode)
{
sbyte* pBuffer; uint size;
errorCode = clang.ModuleMapDescriptor_writeToBuffer(this, options, &pBuffer, &size);
diff --git a/sources/ClangSharp.Interop/Extensions/CXPrintingPolicy.cs b/sources/ClangSharp.Interop/Extensions/CXPrintingPolicy.cs
index a2414503..d4d6aa50 100644
--- a/sources/ClangSharp.Interop/Extensions/CXPrintingPolicy.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXPrintingPolicy.cs
@@ -30,13 +30,13 @@ public void Dispose()
}
}
- public override bool Equals(object? obj) => (obj is CXPrintingPolicy other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXPrintingPolicy other) && Equals(other);
- public bool Equals(CXPrintingPolicy other) => this == other;
+ public readonly bool Equals(CXPrintingPolicy other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public uint GetProperty(CXPrintingPolicyProperty property) => clang.PrintingPolicy_getProperty(this, property);
+ public readonly uint GetProperty(CXPrintingPolicyProperty property) => clang.PrintingPolicy_getProperty(this, property);
- public void SetProperty(CXPrintingPolicyProperty property, uint value) => clang.PrintingPolicy_setProperty(this, property, value);
+ public readonly void SetProperty(CXPrintingPolicyProperty property, uint value) => clang.PrintingPolicy_setProperty(this, property, value);
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXRemapping.cs b/sources/ClangSharp.Interop/Extensions/CXRemapping.cs
index bba0f1a4..6af3cc91 100644
--- a/sources/ClangSharp.Interop/Extensions/CXRemapping.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXRemapping.cs
@@ -28,7 +28,7 @@ public static CXRemapping GetRemappingsFromFileList(ReadOnlySpan filePat
public IntPtr Handle { get; set; }
- public uint NumFiles => clang.remap_getNumFiles(this);
+ public readonly uint NumFiles => clang.remap_getNumFiles(this);
public static explicit operator CXRemapping(void* value) => new CXRemapping((IntPtr)value);
@@ -47,11 +47,11 @@ public void Dispose()
}
}
- public override bool Equals(object? obj) => (obj is CXRemapping other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXRemapping other) && Equals(other);
- public bool Equals(CXRemapping other) => this == other;
+ public readonly bool Equals(CXRemapping other) => this == other;
- public void GetFilenames(uint index, out CXString original, out CXString transformed)
+ public readonly void GetFilenames(uint index, out CXString original, out CXString transformed)
{
fixed (CXString* pOriginal = &original)
fixed (CXString* pTransformed = &transformed)
@@ -60,5 +60,5 @@ public void GetFilenames(uint index, out CXString original, out CXString transfo
}
}
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXSourceLocation.cs b/sources/ClangSharp.Interop/Extensions/CXSourceLocation.cs
index 0feff371..ea9e6368 100644
--- a/sources/ClangSharp.Interop/Extensions/CXSourceLocation.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXSourceLocation.cs
@@ -8,19 +8,19 @@ public unsafe partial struct CXSourceLocation : IEquatable
{
public static CXSourceLocation Null => clang.getNullLocation();
- public bool IsFromMainFile => clang.Location_isFromMainFile(this) != 0;
+ public readonly bool IsFromMainFile => clang.Location_isFromMainFile(this) != 0;
- public bool IsInSystemHeader => clang.Location_isInSystemHeader(this) != 0;
+ public readonly bool IsInSystemHeader => clang.Location_isInSystemHeader(this) != 0;
public static bool operator ==(CXSourceLocation left, CXSourceLocation right) => clang.equalLocations(left, right) != 0;
public static bool operator !=(CXSourceLocation left, CXSourceLocation right) => clang.equalLocations(left, right) == 0;
- public override bool Equals(object? obj) => (obj is CXSourceLocation other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXSourceLocation other) && Equals(other);
- public bool Equals(CXSourceLocation other) => this == other;
+ public readonly bool Equals(CXSourceLocation other) => this == other;
- public void GetExpansionLocation(out CXFile file, out uint line, out uint column, out uint offset)
+ public readonly void GetExpansionLocation(out CXFile file, out uint line, out uint column, out uint offset)
{
fixed (CXFile* pFile = &file)
fixed (uint* pLine = &line)
@@ -31,7 +31,7 @@ public void GetExpansionLocation(out CXFile file, out uint line, out uint column
}
}
- public void GetFileLocation(out CXFile file, out uint line, out uint column, out uint offset)
+ public readonly void GetFileLocation(out CXFile file, out uint line, out uint column, out uint offset)
{
fixed (CXFile* pFile = &file)
fixed (uint* pLine = &line)
@@ -42,9 +42,9 @@ public void GetFileLocation(out CXFile file, out uint line, out uint column, out
}
}
- public override int GetHashCode() => HashCode.Combine(ptr_data, int_data);
+ public override readonly int GetHashCode() => HashCode.Combine(ptr_data, int_data);
- public void GetInstantiationLocation(out CXFile file, out uint line, out uint column, out uint offset)
+ public readonly void GetInstantiationLocation(out CXFile file, out uint line, out uint column, out uint offset)
{
fixed (CXFile* pFile = &file)
fixed (uint* pLine = &line)
@@ -55,7 +55,7 @@ public void GetInstantiationLocation(out CXFile file, out uint line, out uint co
}
}
- public void GetPresumedLocation(out CXString fileName, out uint line, out uint column)
+ public readonly void GetPresumedLocation(out CXString fileName, out uint line, out uint column)
{
fixed (CXString* pFileName = &fileName)
fixed (uint* pLine = &line)
@@ -65,7 +65,7 @@ public void GetPresumedLocation(out CXString fileName, out uint line, out uint c
}
}
- public void GetSpellingLocation(out CXFile file, out uint line, out uint column, out uint offset)
+ public readonly void GetSpellingLocation(out CXFile file, out uint line, out uint column, out uint offset)
{
fixed (CXFile* pFile = &file)
fixed (uint* pLine = &line)
@@ -76,7 +76,7 @@ public void GetSpellingLocation(out CXFile file, out uint line, out uint column,
}
}
- public override string ToString()
+ public override readonly string ToString()
{
GetSpellingLocation(out var file, out var line, out var column, out _);
return $"Line {line}, Column {column} in {file}";
diff --git a/sources/ClangSharp.Interop/Extensions/CXSourceRange.cs b/sources/ClangSharp.Interop/Extensions/CXSourceRange.cs
index cddc8587..4a23ec2a 100644
--- a/sources/ClangSharp.Interop/Extensions/CXSourceRange.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXSourceRange.cs
@@ -8,11 +8,11 @@ public partial struct CXSourceRange : IEquatable
{
public static CXSourceRange Null => clang.getNullRange();
- public CXSourceLocation End => clang.getRangeEnd(this);
+ public readonly CXSourceLocation End => clang.getRangeEnd(this);
- public bool IsNull => clang.Range_isNull(this) != 0;
+ public readonly bool IsNull => clang.Range_isNull(this) != 0;
- public CXSourceLocation Start => clang.getRangeStart(this);
+ public readonly CXSourceLocation Start => clang.getRangeStart(this);
public static bool operator ==(CXSourceRange left, CXSourceRange right) => Equals(left, right);
@@ -22,11 +22,11 @@ public partial struct CXSourceRange : IEquatable
public static CXSourceRange Create(CXSourceLocation begin, CXSourceLocation end) => clang.getRange(begin, end);
- public override bool Equals(object? obj) => (obj is CXSourceRange other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXSourceRange other) && Equals(other);
- public bool Equals(CXSourceRange other) => this == other;
+ public readonly bool Equals(CXSourceRange other) => this == other;
- public override int GetHashCode() => HashCode.Combine(ptr_data, begin_int_data, end_int_data);
+ public override readonly int GetHashCode() => HashCode.Combine(ptr_data, begin_int_data, end_int_data);
- public override string ToString() => $"{Start} to {End}";
+ public override readonly string ToString() => $"{Start} to {End}";
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXSourceRangeList.cs b/sources/ClangSharp.Interop/Extensions/CXSourceRangeList.cs
index 475858ec..465260ab 100644
--- a/sources/ClangSharp.Interop/Extensions/CXSourceRangeList.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXSourceRangeList.cs
@@ -10,7 +10,7 @@ public unsafe partial struct CXSourceRangeList : IDisposable, IReadOnlyCollectio
{
public unsafe CXSourceRange this[uint index] => ranges[index];
- public int Count => (int)count;
+ public readonly int Count => (int)count;
public void Dispose()
{
diff --git a/sources/ClangSharp.Interop/Extensions/CXString.cs b/sources/ClangSharp.Interop/Extensions/CXString.cs
index fbd33795..83d162ca 100644
--- a/sources/ClangSharp.Interop/Extensions/CXString.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXString.cs
@@ -43,7 +43,7 @@ public static CXString ConstructUsr_ObjCProperty(string property, CXString class
return clang.constructUSR_ObjCProperty(marshaledProperty, classUsr);
}
- public string CString
+ public readonly string CString
{
get
{
@@ -58,7 +58,7 @@ public string CString
}
}
- public void Dispose() => clang.disposeString(this);
+ public readonly void Dispose() => clang.disposeString(this);
- public override string ToString() => CString;
+ public override readonly string ToString() => CString;
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXStringSet.cs b/sources/ClangSharp.Interop/Extensions/CXStringSet.cs
index 9509db2e..f991e625 100644
--- a/sources/ClangSharp.Interop/Extensions/CXStringSet.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXStringSet.cs
@@ -10,7 +10,7 @@ public unsafe partial struct CXStringSet : IDisposable, IReadOnlyCollection Strings[index];
- int IReadOnlyCollection.Count => (int)Count;
+ readonly int IReadOnlyCollection.Count => (int)Count;
public void Dispose()
{
diff --git a/sources/ClangSharp.Interop/Extensions/CXTUResourceUsage.cs b/sources/ClangSharp.Interop/Extensions/CXTUResourceUsage.cs
index ed272c9a..a1a39a79 100644
--- a/sources/ClangSharp.Interop/Extensions/CXTUResourceUsage.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXTUResourceUsage.cs
@@ -10,9 +10,9 @@ public partial struct CXTUResourceUsage : IDisposable, IReadOnlyCollection entries[index];
- public int Count => (int)numEntries;
+ public readonly int Count => (int)numEntries;
- public void Dispose() => clang.disposeCXTUResourceUsage(this);
+ public readonly void Dispose() => clang.disposeCXTUResourceUsage(this);
public IEnumerator GetEnumerator()
{
diff --git a/sources/ClangSharp.Interop/Extensions/CXTUResourceUsageEntry.cs b/sources/ClangSharp.Interop/Extensions/CXTUResourceUsageEntry.cs
index eb00a1b8..1ec24c02 100644
--- a/sources/ClangSharp.Interop/Extensions/CXTUResourceUsageEntry.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXTUResourceUsageEntry.cs
@@ -4,7 +4,7 @@ namespace ClangSharp.Interop;
public unsafe partial struct CXTUResourceUsageEntry
{
- public string Name
+ public readonly string Name
{
get
{
@@ -19,5 +19,5 @@ public string Name
}
}
- public override string ToString() => Name;
+ public override readonly string ToString() => Name;
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXTargetInfo.cs b/sources/ClangSharp.Interop/Extensions/CXTargetInfo.cs
index 605f6f37..6ca98652 100644
--- a/sources/ClangSharp.Interop/Extensions/CXTargetInfo.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXTargetInfo.cs
@@ -13,9 +13,9 @@ public CXTargetInfo(IntPtr handle)
public IntPtr Handle { get; set; }
- public int PointerWidth => clang.TargetInfo_getPointerWidth(this);
+ public readonly int PointerWidth => clang.TargetInfo_getPointerWidth(this);
- public CXString Triple => clang.TargetInfo_getTriple(this);
+ public readonly CXString Triple => clang.TargetInfo_getTriple(this);
public static implicit operator CXTargetInfo(CXTargetInfoImpl* value) => new CXTargetInfo((IntPtr)value);
@@ -34,11 +34,11 @@ public void Dispose()
}
}
- public override bool Equals(object? obj) => (obj is CXTargetInfo other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXTargetInfo other) && Equals(other);
- public bool Equals(CXTargetInfo other) => this == other;
+ public readonly bool Equals(CXTargetInfo other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public override string ToString() => Triple.ToString();
+ public override readonly string ToString() => Triple.ToString();
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXToken.cs b/sources/ClangSharp.Interop/Extensions/CXToken.cs
index 62fcaf55..3ee5e844 100644
--- a/sources/ClangSharp.Interop/Extensions/CXToken.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXToken.cs
@@ -6,7 +6,7 @@ namespace ClangSharp.Interop;
public unsafe partial struct CXToken : IEquatable
{
- public CXTokenKind Kind => clang.getTokenKind(this);
+ public readonly CXTokenKind Kind => clang.getTokenKind(this);
public static bool operator ==(CXToken left, CXToken right)
{
@@ -26,17 +26,17 @@ public unsafe partial struct CXToken : IEquatable
(left.ptr_data != right.ptr_data);
}
- public override bool Equals(object? obj) => (obj is CXSourceRange other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXSourceRange other) && Equals(other);
- public bool Equals(CXToken other) => this == other;
+ public readonly bool Equals(CXToken other) => this == other;
- public CXSourceRange GetExtent(CXTranslationUnit translationUnit) => clang.getTokenExtent(translationUnit, this);
+ public readonly CXSourceRange GetExtent(CXTranslationUnit translationUnit) => clang.getTokenExtent(translationUnit, this);
public override int GetHashCode() => HashCode.Combine(int_data[0], int_data[1], int_data[2], int_data[3], (IntPtr)ptr_data);
- public CXSourceLocation GetLocation(CXTranslationUnit translationUnit) => clang.getTokenLocation(translationUnit, this);
+ public readonly CXSourceLocation GetLocation(CXTranslationUnit translationUnit) => clang.getTokenLocation(translationUnit, this);
- public CXString GetSpelling(CXTranslationUnit translationUnit) => clang.getTokenSpelling(translationUnit, this);
+ public readonly CXString GetSpelling(CXTranslationUnit translationUnit) => clang.getTokenSpelling(translationUnit, this);
- public override string ToString() => "";
+ public override readonly string ToString() => "";
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXTranslationUnit.cs b/sources/ClangSharp.Interop/Extensions/CXTranslationUnit.cs
index 7cfb391d..09739a27 100644
--- a/sources/ClangSharp.Interop/Extensions/CXTranslationUnit.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXTranslationUnit.cs
@@ -14,25 +14,25 @@ public CXTranslationUnit(IntPtr handle)
public static CXTranslationUnit_Flags DefaultEditingOptions => (CXTranslationUnit_Flags)clang.defaultEditingTranslationUnitOptions();
- public CXSourceRangeList* AllSkippedRanges => clang.getAllSkippedRanges(this);
+ public readonly CXSourceRangeList* AllSkippedRanges => clang.getAllSkippedRanges(this);
- public CXCursor Cursor => clang.getTranslationUnitCursor(this);
+ public readonly CXCursor Cursor => clang.getTranslationUnitCursor(this);
- public CXReparse_Flags DefaultReparseOptions => (CXReparse_Flags)clang.defaultReparseOptions(this);
+ public readonly CXReparse_Flags DefaultReparseOptions => (CXReparse_Flags)clang.defaultReparseOptions(this);
- public CXSaveTranslationUnit_Flags DefaultSaveOptions => (CXSaveTranslationUnit_Flags)clang.defaultSaveOptions(this);
+ public readonly CXSaveTranslationUnit_Flags DefaultSaveOptions => (CXSaveTranslationUnit_Flags)clang.defaultSaveOptions(this);
- public CXDiagnosticSet DiagnosticSet => (CXDiagnosticSet)clang.getDiagnosticSetFromTU(this);
+ public readonly CXDiagnosticSet DiagnosticSet => (CXDiagnosticSet)clang.getDiagnosticSetFromTU(this);
public IntPtr Handle { get; set; }
- public uint NumDiagnostics => clang.getNumDiagnostics(this);
+ public readonly uint NumDiagnostics => clang.getNumDiagnostics(this);
- public CXTUResourceUsage ResourceUsage => clang.getCXTUResourceUsage(this);
+ public readonly CXTUResourceUsage ResourceUsage => clang.getCXTUResourceUsage(this);
- public CXString Spelling => clang.getTranslationUnitSpelling(this);
+ public readonly CXString Spelling => clang.getTranslationUnitSpelling(this);
- public CXTargetInfo TargetInfo => clang.getTranslationUnitTargetInfo(this);
+ public readonly CXTargetInfo TargetInfo => clang.getTranslationUnitTargetInfo(this);
public static implicit operator CXTranslationUnit(CXTranslationUnitImpl* value) => new CXTranslationUnit((IntPtr)value);
@@ -112,7 +112,7 @@ public static CXErrorCode TryParseFullArgv(CXIndex index, string sourceFileName,
}
}
- public void AnnotateTokens(ReadOnlySpan tokens, Span cursors)
+ public readonly void AnnotateTokens(ReadOnlySpan tokens, Span cursors)
{
fixed (CXToken* pTokens = tokens)
fixed (CXCursor* pCursors = cursors)
@@ -121,7 +121,7 @@ public void AnnotateTokens(ReadOnlySpan tokens, Span cursors)
}
}
- public CXCodeCompleteResults* CodeCompleteAt(string completeFilename, uint completeLine, uint completeColumn, ReadOnlySpan unsavedFiles, CXCodeComplete_Flags options)
+ public readonly CXCodeCompleteResults* CodeCompleteAt(string completeFilename, uint completeLine, uint completeColumn, ReadOnlySpan unsavedFiles, CXCodeComplete_Flags options)
{
using var marshaledCompleteFilename = new MarshaledString(completeFilename);
@@ -140,7 +140,7 @@ public void Dispose()
}
}
- public void DisposeTokens(ReadOnlySpan tokens)
+ public readonly void DisposeTokens(ReadOnlySpan tokens)
{
fixed (CXToken* pTokens = tokens)
{
@@ -148,23 +148,23 @@ public void DisposeTokens(ReadOnlySpan tokens)
}
}
- public override bool Equals(object? obj) => (obj is CXTranslationUnit other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXTranslationUnit other) && Equals(other);
- public bool Equals(CXTranslationUnit other) => this == other;
+ public readonly bool Equals(CXTranslationUnit other) => this == other;
- public CXResult FindIncludesInFile(CXFile file, CXCursorAndRangeVisitor visitor) => clang.findIncludesInFile(this, file, visitor);
+ public readonly CXResult FindIncludesInFile(CXFile file, CXCursorAndRangeVisitor visitor) => clang.findIncludesInFile(this, file, visitor);
- public CXCursor GetCursor(CXSourceLocation location) => clang.getCursor(this, location);
+ public readonly CXCursor GetCursor(CXSourceLocation location) => clang.getCursor(this, location);
- public CXDiagnostic GetDiagnostic(uint index) => (CXDiagnostic)clang.getDiagnostic(this, index);
+ public readonly CXDiagnostic GetDiagnostic(uint index) => (CXDiagnostic)clang.getDiagnostic(this, index);
- public CXFile GetFile(string fileName)
+ public readonly CXFile GetFile(string fileName)
{
using var marshaledFileName = new MarshaledString(fileName);
return GetFile(marshaledFileName.AsSpan());
}
- public CXFile GetFile(ReadOnlySpan fileName)
+ public readonly CXFile GetFile(ReadOnlySpan fileName)
{
fixed (byte* pFileName = fileName)
{
@@ -172,7 +172,7 @@ public CXFile GetFile(ReadOnlySpan fileName)
}
}
- public ReadOnlySpan GetFileContents(CXFile file, out UIntPtr size)
+ public readonly ReadOnlySpan GetFileContents(CXFile file, out UIntPtr size)
{
fixed (UIntPtr* pSize = &size)
{
@@ -181,33 +181,33 @@ public ReadOnlySpan GetFileContents(CXFile file, out UIntPtr size)
}
}
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public void GetInclusions(CXInclusionVisitor visitor, CXClientData clientData)
+ public readonly void GetInclusions(CXInclusionVisitor visitor, CXClientData clientData)
{
var pVisitor = (delegate* unmanaged[Cdecl])Marshal.GetFunctionPointerForDelegate(visitor);
GetInclusions(pVisitor, clientData);
GC.KeepAlive(visitor);
}
- public void GetInclusions(delegate* unmanaged[Cdecl] visitor, CXClientData clientData)
+ public readonly void GetInclusions(delegate* unmanaged[Cdecl] visitor, CXClientData clientData)
{
clang.getInclusions(this, visitor, clientData);
}
- public CXSourceLocation GetLocation(CXFile file, uint line, uint column) => clang.getLocation(this, file, line, column);
+ public readonly CXSourceLocation GetLocation(CXFile file, uint line, uint column) => clang.getLocation(this, file, line, column);
- public CXSourceLocation GetLocationForOffset(CXFile file, uint offset) => clang.getLocationForOffset(this, file, offset);
+ public readonly CXSourceLocation GetLocationForOffset(CXFile file, uint offset) => clang.getLocationForOffset(this, file, offset);
- public CXModule GetModuleForFile(CXFile file) => (CXModule)clang.getModuleForFile(this, file);
+ public readonly CXModule GetModuleForFile(CXFile file) => (CXModule)clang.getModuleForFile(this, file);
- public CXSourceRangeList* GetSkippedRanges(CXFile file) => clang.getSkippedRanges(this, file);
+ public readonly CXSourceRangeList* GetSkippedRanges(CXFile file) => clang.getSkippedRanges(this, file);
- public CXToken* GetToken(CXSourceLocation sourceLocation) => clang.getToken(this, sourceLocation);
+ public readonly CXToken* GetToken(CXSourceLocation sourceLocation) => clang.getToken(this, sourceLocation);
- public bool IsFileMultipleIncludeGuarded(CXFile file) => clang.isFileMultipleIncludeGuarded(this, file) != 0;
+ public readonly bool IsFileMultipleIncludeGuarded(CXFile file) => clang.isFileMultipleIncludeGuarded(this, file) != 0;
- public CXErrorCode Reparse(ReadOnlySpan unsavedFiles, CXReparse_Flags options)
+ public readonly CXErrorCode Reparse(ReadOnlySpan unsavedFiles, CXReparse_Flags options)
{
fixed (CXUnsavedFile* pUnsavedFiles = unsavedFiles)
{
@@ -215,15 +215,15 @@ public CXErrorCode Reparse(ReadOnlySpan unsavedFiles, CXReparse_F
}
}
- public CXSaveError Save(string fileName, CXSaveTranslationUnit_Flags options)
+ public readonly CXSaveError Save(string fileName, CXSaveTranslationUnit_Flags options)
{
using var marshaledFileName = new MarshaledString(fileName);
return (CXSaveError)clang.saveTranslationUnit(this, marshaledFileName, (uint)options);
}
- public bool Suspend() => clang.suspendTranslationUnit(this) != 0;
+ public readonly bool Suspend() => clang.suspendTranslationUnit(this) != 0;
- public Span Tokenize(CXSourceRange sourceRange)
+ public readonly Span Tokenize(CXSourceRange sourceRange)
{
CXToken* pTokens; uint numTokens;
clang.tokenize(this, sourceRange, &pTokens, &numTokens);
@@ -243,5 +243,5 @@ public Span Tokenize(CXSourceRange sourceRange)
#endif
}
- public override string ToString() => Spelling.ToString();
+ public override readonly string ToString() => Spelling.ToString();
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXType.cs b/sources/ClangSharp.Interop/Extensions/CXType.cs
index b99c833f..4430c0b7 100644
--- a/sources/ClangSharp.Interop/Extensions/CXType.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXType.cs
@@ -11,123 +11,123 @@ namespace ClangSharp.Interop;
[DebuggerDisplay("{DebuggerDisplayString,nq}")]
public unsafe partial struct CXType : IEquatable
{
- public uint AddressSpace => (kind != CXType_Invalid) ? clang.getAddressSpace(this) : default;
+ public readonly uint AddressSpace => (kind != CXType_Invalid) ? clang.getAddressSpace(this) : default;
- public CXCursor AddrSpaceExpr => clangsharp.Type_getAddrSpaceExpr(this);
+ public readonly CXCursor AddrSpaceExpr => clangsharp.Type_getAddrSpaceExpr(this);
- public CXType AdjustedType => (kind != CXType_Invalid) ? clangsharp.Type_getAdjustedType(this) : default;
+ public readonly CXType AdjustedType => (kind != CXType_Invalid) ? clangsharp.Type_getAdjustedType(this) : default;
- public long AlignOf => clang.Type_getAlignOf(this);
+ public readonly long AlignOf => clang.Type_getAlignOf(this);
- public CXType ArrayElementType => clang.getArrayElementType(this);
+ public readonly CXType ArrayElementType => clang.getArrayElementType(this);
- public long ArraySize => clang.getArraySize(this);
+ public readonly long ArraySize => clang.getArraySize(this);
- public CX_AttrKind AttrKind => clangsharp.Type_getAttrKind(this);
+ public readonly CX_AttrKind AttrKind => clangsharp.Type_getAttrKind(this);
- public CXType BaseType => clangsharp.Type_getBaseType(this);
+ public readonly CXType BaseType => clangsharp.Type_getBaseType(this);
- public CXType CanonicalType => clang.getCanonicalType(this);
+ public readonly CXType CanonicalType => clang.getCanonicalType(this);
- public CXType ClassType => clang.Type_getClassType(this);
+ public readonly CXType ClassType => clang.Type_getClassType(this);
- public CXCursor ColumnExpr => clangsharp.Type_getColumnExpr(this);
+ public readonly CXCursor ColumnExpr => clangsharp.Type_getColumnExpr(this);
- public CXRefQualifierKind CXXRefQualifier => clang.Type_getCXXRefQualifier(this);
+ public readonly CXRefQualifierKind CXXRefQualifier => clang.Type_getCXXRefQualifier(this);
- public CXType DecayedType => clangsharp.Type_getDecayedType(this);
+ public readonly CXType DecayedType => clangsharp.Type_getDecayedType(this);
- public CXCursor Declaration => (kind != CXType_Invalid) ? clangsharp.Type_getDeclaration(this) : default;
+ public readonly CXCursor Declaration => (kind != CXType_Invalid) ? clangsharp.Type_getDeclaration(this) : default;
- public CXType DeducedType => (kind != CXType_Invalid) ? clangsharp.Type_getDeducedType(this) : default;
+ public readonly CXType DeducedType => (kind != CXType_Invalid) ? clangsharp.Type_getDeducedType(this) : default;
- public int Depth => clangsharp.Type_getDepth(this);
+ public readonly int Depth => clangsharp.Type_getDepth(this);
- public CXType Desugar => (kind != CXType_Invalid) ? clangsharp.Type_desugar(this) : default;
+ public readonly CXType Desugar => (kind != CXType_Invalid) ? clangsharp.Type_desugar(this) : default;
- public CXType ElementType => (kind != CXType_Invalid) ? clangsharp.Type_getElementType(this) :default;
+ public readonly CXType ElementType => (kind != CXType_Invalid) ? clangsharp.Type_getElementType(this) :default;
- public CXType EquivalentType => (kind != CXType_Invalid) ? clangsharp.Type_getEquivalentType(this) : default;
+ public readonly CXType EquivalentType => (kind != CXType_Invalid) ? clangsharp.Type_getEquivalentType(this) : default;
- public CXCursor_ExceptionSpecificationKind ExceptionSpecificationType => (CXCursor_ExceptionSpecificationKind)clang.getExceptionSpecificationType(this);
+ public readonly CXCursor_ExceptionSpecificationKind ExceptionSpecificationType => (CXCursor_ExceptionSpecificationKind)clang.getExceptionSpecificationType(this);
- public CXCallingConv FunctionTypeCallingConv => clang.getFunctionTypeCallingConv(this);
+ public readonly CXCallingConv FunctionTypeCallingConv => clang.getFunctionTypeCallingConv(this);
- public int Index => clangsharp.Type_getIndex(this);
+ public readonly int Index => clangsharp.Type_getIndex(this);
- public CXType InjectedSpecializationType => (kind != CXType_Invalid) ? clangsharp.Type_getInjectedSpecializationType(this) : default;
+ public readonly CXType InjectedSpecializationType => (kind != CXType_Invalid) ? clangsharp.Type_getInjectedSpecializationType(this) : default;
- public CXType InjectedTST => (kind != CXType_Invalid) ? clangsharp.Type_getInjectedTST(this) : default;
+ public readonly CXType InjectedTST => (kind != CXType_Invalid) ? clangsharp.Type_getInjectedTST(this) : default;
- public bool IsCanonical => Equals(CanonicalType);
+ public readonly bool IsCanonical => Equals(CanonicalType);
- public bool IsConstQualified => clang.isConstQualifiedType(this) != 0;
+ public readonly bool IsConstQualified => clang.isConstQualifiedType(this) != 0;
- public bool IsFunctionTypeVariadic => clang.isFunctionTypeVariadic(this) != 0;
+ public readonly bool IsFunctionTypeVariadic => clang.isFunctionTypeVariadic(this) != 0;
- public bool IsPODType => clang.isPODType(this) != 0;
+ public readonly bool IsPODType => clang.isPODType(this) != 0;
- public bool IsRestrictQualified => clang.isRestrictQualifiedType(this) != 0;
+ public readonly bool IsRestrictQualified => clang.isRestrictQualifiedType(this) != 0;
- public bool IsSigned => clangsharp.Type_getIsSigned(this) != 0;
+ public readonly bool IsSigned => clangsharp.Type_getIsSigned(this) != 0;
- public bool IsSugared => (kind != CXType_Invalid) && clangsharp.Type_getIsSugared(this) != 0;
+ public readonly bool IsSugared => (kind != CXType_Invalid) && clangsharp.Type_getIsSugared(this) != 0;
- public bool IsTransparentTagTypedef => clang.Type_isTransparentTagTypedef(this) != 0;
+ public readonly bool IsTransparentTagTypedef => clang.Type_isTransparentTagTypedef(this) != 0;
- public bool IsTypeAlias => clangsharp.Type_getIsTypeAlias(this) != 0;
+ public readonly bool IsTypeAlias => clangsharp.Type_getIsTypeAlias(this) != 0;
- public bool IsUnsigned => clangsharp.Type_getIsUnsigned(this) != 0;
+ public readonly bool IsUnsigned => clangsharp.Type_getIsUnsigned(this) != 0;
- public bool IsVolatileQualified => clang.isVolatileQualifiedType(this) != 0;
+ public readonly bool IsVolatileQualified => clang.isVolatileQualifiedType(this) != 0;
- public CXString KindSpelling => clang.getTypeKindSpelling(kind);
+ public readonly CXString KindSpelling => clang.getTypeKindSpelling(kind);
- public CXType ModifiedType => clangsharp.Type_getModifiedType(this);
+ public readonly CXType ModifiedType => clangsharp.Type_getModifiedType(this);
- public CXType NamedType => clang.Type_getNamedType(this);
+ public readonly CXType NamedType => clang.Type_getNamedType(this);
- public CXType NonReferenceType => (kind != CXType_Invalid) ? clang.getNonReferenceType(this) : default;
+ public readonly CXType NonReferenceType => (kind != CXType_Invalid) ? clang.getNonReferenceType(this) : default;
- public CXTypeNullabilityKind Nullability => clang.Type_getNullability(this);
+ public readonly CXTypeNullabilityKind Nullability => clang.Type_getNullability(this);
- public int NumArgTypes => clang.getNumArgTypes(this);
+ public readonly int NumArgTypes => clang.getNumArgTypes(this);
- public int NumBits => clangsharp.Type_getNumBits(this);
+ public readonly int NumBits => clangsharp.Type_getNumBits(this);
- public CXCursor NumBitsExpr => clangsharp.Type_getNumBitsExpr(this);
+ public readonly CXCursor NumBitsExpr => clangsharp.Type_getNumBitsExpr(this);
- public int NumColumns => clangsharp.Type_getNumColumns(this);
+ public readonly int NumColumns => clangsharp.Type_getNumColumns(this);
- public int NumElementsFlattened => clangsharp.Type_getNumElementsFlattened(this);
+ public readonly int NumElementsFlattened => clangsharp.Type_getNumElementsFlattened(this);
- public int NumRows => clangsharp.Type_getNumRows(this);
+ public readonly int NumRows => clangsharp.Type_getNumRows(this);
- public long NumElements => clang.getNumElements(this);
+ public readonly long NumElements => clang.getNumElements(this);
- public uint NumObjCProtocolRefs => clang.Type_getNumObjCProtocolRefs(this);
+ public readonly uint NumObjCProtocolRefs => clang.Type_getNumObjCProtocolRefs(this);
- public uint NumObjCTypeArgs => clang.Type_getNumObjCTypeArgs(this);
+ public readonly uint NumObjCTypeArgs => clang.Type_getNumObjCTypeArgs(this);
- public int NumTemplateArguments => clang.Type_getNumTemplateArguments(this);
+ public readonly int NumTemplateArguments => clang.Type_getNumTemplateArguments(this);
- public CXType ObjCObjectBaseType => clang.Type_getObjCObjectBaseType(this);
+ public readonly CXType ObjCObjectBaseType => clang.Type_getObjCObjectBaseType(this);
- public CXType OriginalType => (kind != CXType_Invalid) ? clangsharp.Type_getOriginalType(this) : default;
+ public readonly CXType OriginalType => (kind != CXType_Invalid) ? clangsharp.Type_getOriginalType(this) : default;
- public CXCursor OwnedTagDecl => (kind != CXType_Invalid) ? clangsharp.Type_getOwnedTagDecl(this) : default;
+ public readonly CXCursor OwnedTagDecl => (kind != CXType_Invalid) ? clangsharp.Type_getOwnedTagDecl(this) : default;
- public CXType PointeeType => (kind != CXType_Invalid) ? clangsharp.Type_getPointeeType(this) : default;
+ public readonly CXType PointeeType => (kind != CXType_Invalid) ? clangsharp.Type_getPointeeType(this) : default;
- public CXType ResultType => clang.getResultType(this);
+ public readonly CXType ResultType => clang.getResultType(this);
- public CXCursor RowExpr => (kind != CXType_Invalid) ? clangsharp.Type_getRowExpr(this) : default;
+ public readonly CXCursor RowExpr => (kind != CXType_Invalid) ? clangsharp.Type_getRowExpr(this) : default;
- public CXCursor SizeExpr => (kind != CXType_Invalid) ? clangsharp.Type_getSizeExpr(this) : default;
+ public readonly CXCursor SizeExpr => (kind != CXType_Invalid) ? clangsharp.Type_getSizeExpr(this) : default;
- public long SizeOf => clang.Type_getSizeOf(this);
+ public readonly long SizeOf => clang.Type_getSizeOf(this);
- public CXString Spelling => (kind != CXType_Invalid) ? clang.getTypeSpelling(this) : default;
+ public readonly CXString Spelling => (kind != CXType_Invalid) ? clang.getTypeSpelling(this) : default;
public CX_TemplateName TemplateName
{
@@ -139,9 +139,9 @@ public CX_TemplateName TemplateName
}
}
- public CX_TypeClass TypeClass => clangsharp.Type_getTypeClass(this);
+ public readonly CX_TypeClass TypeClass => clangsharp.Type_getTypeClass(this);
- public string TypeClassSpelling
+ public readonly string TypeClassSpelling
{
get
{
@@ -210,47 +210,47 @@ public string TypeClassSpelling
}
}
- public CXString TypedefName => (kind != CXType_Invalid) ? clang.getTypedefName(this) : default;
+ public readonly CXString TypedefName => (kind != CXType_Invalid) ? clang.getTypedefName(this) : default;
- public CXCursor UnderlyingExpr => (kind != CXType_Invalid) ? clangsharp.Type_getUnderlyingExpr(this) : default;
+ public readonly CXCursor UnderlyingExpr => (kind != CXType_Invalid) ? clangsharp.Type_getUnderlyingExpr(this) : default;
- public CXType UnderlyingType => (kind != CXType_Invalid) ? clangsharp.Type_getUnderlyingType(this) : default;
+ public readonly CXType UnderlyingType => (kind != CXType_Invalid) ? clangsharp.Type_getUnderlyingType(this) : default;
- public CXType UnqualifiedType => (kind != CXType_Invalid) ? clang.getUnqualifiedType(this) : default;
+ public readonly CXType UnqualifiedType => (kind != CXType_Invalid) ? clang.getUnqualifiedType(this) : default;
- public CXType ValueType => clang.Type_getValueType(this);
+ public readonly CXType ValueType => clang.Type_getValueType(this);
- internal string DebuggerDisplayString => $"{TypeClassSpelling}: {this}";
+ internal readonly string DebuggerDisplayString => $"{TypeClassSpelling}: {this}";
public static bool operator ==(CXType left, CXType right) => clang.equalTypes(left, right) != 0;
public static bool operator !=(CXType left, CXType right) => clang.equalTypes(left, right) == 0;
- public override bool Equals(object? obj) => (obj is CXType other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXType other) && Equals(other);
- public bool Equals(CXType other) => this == other;
+ public readonly bool Equals(CXType other) => this == other;
- public CXType GetArgType(uint i) => clang.getArgType(this, i);
+ public readonly CXType GetArgType(uint i) => clang.getArgType(this, i);
public override int GetHashCode() => HashCode.Combine(kind, (IntPtr)data[0], (IntPtr)data[1]);
- public CXString GetObjCEncoding() => clang.Type_getObjCEncoding(this);
+ public readonly CXString GetObjCEncoding() => clang.Type_getObjCEncoding(this);
- public CXCursor GetObjCProtocolDecl(uint i) => clang.Type_getObjCProtocolDecl(this, i);
+ public readonly CXCursor GetObjCProtocolDecl(uint i) => clang.Type_getObjCProtocolDecl(this, i);
- public CXType GetObjCTypeArg(uint i) => clang.Type_getObjCTypeArg(this, i);
+ public readonly CXType GetObjCTypeArg(uint i) => clang.Type_getObjCTypeArg(this, i);
- public long GetOffsetOf(string s)
+ public readonly long GetOffsetOf(string s)
{
using var marshaledS = new MarshaledString(s);
return clang.Type_getOffsetOf(this, marshaledS);
}
- public CX_TemplateArgument GetTemplateArgument(uint i) => clangsharp.Type_getTemplateArgument(this, i);
+ public readonly CX_TemplateArgument GetTemplateArgument(uint i) => clangsharp.Type_getTemplateArgument(this, i);
- public override string ToString() => Spelling.ToString();
+ public override readonly string ToString() => Spelling.ToString();
- public CXVisitorResult VisitFields(CXFieldVisitor visitor, CXClientData clientData)
+ public readonly CXVisitorResult VisitFields(CXFieldVisitor visitor, CXClientData clientData)
{
var pVisitor = (delegate* unmanaged[Cdecl])Marshal.GetFunctionPointerForDelegate(visitor);
var result = VisitFields(pVisitor, clientData);
@@ -259,7 +259,7 @@ public CXVisitorResult VisitFields(CXFieldVisitor visitor, CXClientData clientDa
return result;
}
- public CXVisitorResult VisitFields(delegate* unmanaged[Cdecl] visitor, CXClientData clientData)
+ public readonly CXVisitorResult VisitFields(delegate* unmanaged[Cdecl] visitor, CXClientData clientData)
{
return (CXVisitorResult)clang.Type_visitFields(this, visitor, clientData);
}
diff --git a/sources/ClangSharp.Interop/Extensions/CXUnsavedFile.cs b/sources/ClangSharp.Interop/Extensions/CXUnsavedFile.cs
index 2a14565b..77917126 100644
--- a/sources/ClangSharp.Interop/Extensions/CXUnsavedFile.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXUnsavedFile.cs
@@ -64,9 +64,9 @@ public void Dispose()
}
}
- public ReadOnlySpan ContentsSpan => new ReadOnlySpan(Contents, (int)Length);
+ public readonly ReadOnlySpan ContentsSpan => new ReadOnlySpan(Contents, (int)Length);
- public string FilenameString
+ public readonly string FilenameString
{
get
{
diff --git a/sources/ClangSharp.Interop/Extensions/CXVirtualFileOverlay.cs b/sources/ClangSharp.Interop/Extensions/CXVirtualFileOverlay.cs
index 208737dd..bdf8c07c 100644
--- a/sources/ClangSharp.Interop/Extensions/CXVirtualFileOverlay.cs
+++ b/sources/ClangSharp.Interop/Extensions/CXVirtualFileOverlay.cs
@@ -23,7 +23,7 @@ public CXVirtualFileOverlay(IntPtr handle)
public static CXVirtualFileOverlay Create(uint options) => clang.VirtualFileOverlay_create(options);
- public CXErrorCode AddFileMapping(string? virtualPath, string? realPath)
+ public readonly CXErrorCode AddFileMapping(string? virtualPath, string? realPath)
{
using var marshaledVirtualPath = new MarshaledString(virtualPath);
using var marshaledRealPath = new MarshaledString(realPath);
@@ -39,15 +39,15 @@ public void Dispose()
}
}
- public override bool Equals(object? obj) => (obj is CXVirtualFileOverlay other) && Equals(other);
+ public override readonly bool Equals(object? obj) => (obj is CXVirtualFileOverlay other) && Equals(other);
- public bool Equals(CXVirtualFileOverlay other) => this == other;
+ public readonly bool Equals(CXVirtualFileOverlay other) => this == other;
- public override int GetHashCode() => Handle.GetHashCode();
+ public override readonly int GetHashCode() => Handle.GetHashCode();
- public CXErrorCode SetCaseSensitivity(bool caseSensitive) => clang.VirtualFileOverlay_setCaseSensitivity(this, caseSensitive ? 1 : 0);
+ public readonly CXErrorCode SetCaseSensitivity(bool caseSensitive) => clang.VirtualFileOverlay_setCaseSensitivity(this, caseSensitive ? 1 : 0);
- public Span WriteToBuffer(uint options, out CXErrorCode errorCode)
+ public readonly Span WriteToBuffer(uint options, out CXErrorCode errorCode)
{
sbyte* pBuffer; uint size;
errorCode = clang.VirtualFileOverlay_writeToBuffer(this, options, &pBuffer, &size);
diff --git a/sources/ClangSharp.Interop/Extensions/CX_TemplateArgument.cs b/sources/ClangSharp.Interop/Extensions/CX_TemplateArgument.cs
index 2dcf942e..c45baac1 100644
--- a/sources/ClangSharp.Interop/Extensions/CX_TemplateArgument.cs
+++ b/sources/ClangSharp.Interop/Extensions/CX_TemplateArgument.cs
@@ -6,33 +6,33 @@ namespace ClangSharp.Interop;
public unsafe partial struct CX_TemplateArgument : IDisposable
{
- public CXCursor AsDecl => clangsharp.TemplateArgument_getAsDecl(this);
+ public readonly CXCursor AsDecl => clangsharp.TemplateArgument_getAsDecl(this);
- public CXCursor AsExpr => clangsharp.TemplateArgument_getAsExpr(this);
+ public readonly CXCursor AsExpr => clangsharp.TemplateArgument_getAsExpr(this);
- public long AsIntegral => clangsharp.TemplateArgument_getAsIntegral(this);
+ public readonly long AsIntegral => clangsharp.TemplateArgument_getAsIntegral(this);
- public CX_TemplateName AsTemplate => clangsharp.TemplateArgument_getAsTemplate(this);
+ public readonly CX_TemplateName AsTemplate => clangsharp.TemplateArgument_getAsTemplate(this);
- public CX_TemplateName AsTemplateOrTemplatePattern => clangsharp.TemplateArgument_getAsTemplateOrTemplatePattern(this);
+ public readonly CX_TemplateName AsTemplateOrTemplatePattern => clangsharp.TemplateArgument_getAsTemplateOrTemplatePattern(this);
- public CXType AsType => clangsharp.TemplateArgument_getAsType(this);
+ public readonly CXType AsType => clangsharp.TemplateArgument_getAsType(this);
- public CX_TemplateArgumentDependence Dependence => clangsharp.TemplateArgument_getDependence(this);
+ public readonly CX_TemplateArgumentDependence Dependence => clangsharp.TemplateArgument_getDependence(this);
- public CXType IntegralType => clangsharp.TemplateArgument_getIntegralType(this);
+ public readonly CXType IntegralType => clangsharp.TemplateArgument_getIntegralType(this);
- public CXType NonTypeTemplateArgumentType => clangsharp.TemplateArgument_getNonTypeTemplateArgumentType(this);
+ public readonly CXType NonTypeTemplateArgumentType => clangsharp.TemplateArgument_getNonTypeTemplateArgumentType(this);
- public CXType NullPtrType => clangsharp.TemplateArgument_getNullPtrType(this);
+ public readonly CXType NullPtrType => clangsharp.TemplateArgument_getNullPtrType(this);
- public int NumPackElements => clangsharp.TemplateArgument_getNumPackElements(this);
+ public readonly int NumPackElements => clangsharp.TemplateArgument_getNumPackElements(this);
- public CX_TemplateArgument PackExpansionPattern => clangsharp.TemplateArgument_getPackExpansionPattern(this);
+ public readonly CX_TemplateArgument PackExpansionPattern => clangsharp.TemplateArgument_getPackExpansionPattern(this);
- public CXType ParamTypeForDecl => clangsharp.TemplateArgument_getParamTypeForDecl(this);
+ public readonly CXType ParamTypeForDecl => clangsharp.TemplateArgument_getParamTypeForDecl(this);
- public CX_TemplateArgument GetPackElement(uint i) => clangsharp.TemplateArgument_getPackElement(this, i);
+ public readonly CX_TemplateArgument GetPackElement(uint i) => clangsharp.TemplateArgument_getPackElement(this, i);
- public void Dispose() => clangsharp.TemplateArgument_dispose(this);
+ public readonly void Dispose() => clangsharp.TemplateArgument_dispose(this);
}
diff --git a/sources/ClangSharp.Interop/Extensions/CX_TemplateArgumentLoc.cs b/sources/ClangSharp.Interop/Extensions/CX_TemplateArgumentLoc.cs
index 2b7e43af..d2d2373f 100644
--- a/sources/ClangSharp.Interop/Extensions/CX_TemplateArgumentLoc.cs
+++ b/sources/ClangSharp.Interop/Extensions/CX_TemplateArgumentLoc.cs
@@ -4,19 +4,19 @@ namespace ClangSharp.Interop;
public unsafe partial struct CX_TemplateArgumentLoc
{
- public CX_TemplateArgument Argument => clangsharp.TemplateArgumentLoc_getArgument(this);
+ public readonly CX_TemplateArgument Argument => clangsharp.TemplateArgumentLoc_getArgument(this);
- public CXSourceLocation Location => clangsharp.TemplateArgumentLoc_getLocation(this);
+ public readonly CXSourceLocation Location => clangsharp.TemplateArgumentLoc_getLocation(this);
- public CXCursor SourceDeclExpression => clangsharp.TemplateArgumentLoc_getSourceDeclExpression(this);
+ public readonly CXCursor SourceDeclExpression => clangsharp.TemplateArgumentLoc_getSourceDeclExpression(this);
- public CXCursor SourceExpression => clangsharp.TemplateArgumentLoc_getSourceExpression(this);
+ public readonly CXCursor SourceExpression => clangsharp.TemplateArgumentLoc_getSourceExpression(this);
- public CXCursor SourceIntegralExpression => clangsharp.TemplateArgumentLoc_getSourceIntegralExpression(this);
+ public readonly CXCursor SourceIntegralExpression => clangsharp.TemplateArgumentLoc_getSourceIntegralExpression(this);
- public CXCursor SourceNullPtrExpression => clangsharp.TemplateArgumentLoc_getSourceNullPtrExpression(this);
+ public readonly CXCursor SourceNullPtrExpression => clangsharp.TemplateArgumentLoc_getSourceNullPtrExpression(this);
- public CXSourceRange SourceRange => clangsharp.TemplateArgumentLoc_getSourceRange(this);
+ public readonly CXSourceRange SourceRange => clangsharp.TemplateArgumentLoc_getSourceRange(this);
- public CXSourceRange SourceRangeRaw => clangsharp.TemplateArgumentLoc_getSourceRangeRaw(this);
+ public readonly CXSourceRange SourceRangeRaw => clangsharp.TemplateArgumentLoc_getSourceRangeRaw(this);
}
diff --git a/sources/ClangSharp.Interop/Extensions/CX_TemplateName.cs b/sources/ClangSharp.Interop/Extensions/CX_TemplateName.cs
index b2a35743..7545485c 100644
--- a/sources/ClangSharp.Interop/Extensions/CX_TemplateName.cs
+++ b/sources/ClangSharp.Interop/Extensions/CX_TemplateName.cs
@@ -5,5 +5,5 @@ namespace ClangSharp.Interop;
public unsafe partial struct CX_TemplateName
{
- public CXCursor AsTemplateDecl => clangsharp.TemplateName_getAsTemplateDecl(this);
+ public readonly CXCursor AsTemplateDecl => clangsharp.TemplateName_getAsTemplateDecl(this);
}
diff --git a/sources/ClangSharp.Interop/Extensions/clang.ResolveLibrary.cs b/sources/ClangSharp.Interop/Extensions/clang.ResolveLibrary.cs
deleted file mode 100644
index ef1759eb..00000000
--- a/sources/ClangSharp.Interop/Extensions/clang.ResolveLibrary.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-
-using System;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-namespace ClangSharp.Interop;
-
-public static unsafe partial class @clang
-{
- public static event DllImportResolver? ResolveLibrary;
-
- static @clang()
- {
- NativeLibrary.SetDllImportResolver(Assembly.GetExecutingAssembly(), OnDllImport);
- }
-
- private static IntPtr OnDllImport(string libraryName, Assembly assembly, DllImportSearchPath? searchPath)
- {
- var result = TryResolveLibrary(libraryName, assembly, searchPath, out var nativeLibrary) ? nativeLibrary
- : libraryName.Equals("libclang") && TryResolveClang(assembly, searchPath, out nativeLibrary) ? nativeLibrary
- : libraryName.Equals("libClangSharp") && TryResolveClangSharp(assembly, searchPath, out nativeLibrary) ? nativeLibrary
- : IntPtr.Zero;
-
- if (result == IntPtr.Zero)
- {
- Console.WriteLine();
- Console.WriteLine("*****IMPORTANT*****");
- Console.WriteLine($"Failed to resolve {libraryName}.");
- Console.WriteLine("If you are running as a dotnet tool, you may need to manually copy the appropriate DLLs from NuGet due to limitations in the dotnet tool support. Please see https://github.com/dotnet/clangsharp for more details.");
- Console.WriteLine("*****IMPORTANT*****");
- Console.WriteLine();
- }
- return result;
- }
-
- private static bool TryResolveClang(Assembly assembly, DllImportSearchPath? searchPath, out IntPtr nativeLibrary)
- {
- return (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && NativeLibrary.TryLoad("libclang.so.16", assembly, searchPath, out nativeLibrary))
- || (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && NativeLibrary.TryLoad("libclang-16", assembly, searchPath, out nativeLibrary))
- || (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && NativeLibrary.TryLoad("libclang.so.1", assembly, searchPath, out nativeLibrary))
- || NativeLibrary.TryLoad("libclang", assembly, searchPath, out nativeLibrary);
- }
-
- private static bool TryResolveClangSharp(Assembly assembly, DllImportSearchPath? searchPath, out IntPtr nativeLibrary) => NativeLibrary.TryLoad("libClangSharp", assembly, searchPath, out nativeLibrary);
-
- private static bool TryResolveLibrary(string libraryName, Assembly assembly, DllImportSearchPath? searchPath, out IntPtr nativeLibrary)
- {
- var resolveLibrary = ResolveLibrary;
-
- if (resolveLibrary != null)
- {
- var resolvers = resolveLibrary.GetInvocationList();
-
- foreach (DllImportResolver resolver in resolvers.Cast())
- {
- try
- {
- nativeLibrary = resolver(libraryName, assembly, searchPath);
- }
- catch
- {
- nativeLibrary = IntPtr.Zero;
- }
-
- if (nativeLibrary != IntPtr.Zero)
- {
- return true;
- }
- }
- }
-
- nativeLibrary = IntPtr.Zero;
- return false;
- }
-}
diff --git a/sources/ClangSharp.Interop/ILLink.Substitutions.xml b/sources/ClangSharp.Interop/ILLink.Substitutions.xml
new file mode 100644
index 00000000..b68e458b
--- /dev/null
+++ b/sources/ClangSharp.Interop/ILLink.Substitutions.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sources/ClangSharp.Interop/Internals/MarshaledString.cs b/sources/ClangSharp.Interop/Internals/MarshaledString.cs
index 919467d6..1d6c64dc 100644
--- a/sources/ClangSharp.Interop/Internals/MarshaledString.cs
+++ b/sources/ClangSharp.Interop/Internals/MarshaledString.cs
@@ -31,7 +31,7 @@ public MarshaledString(string? input)
Value = (sbyte*)value;
}
- public ReadOnlySpan AsSpan() => new ReadOnlySpan(Value, Length);
+ public readonly ReadOnlySpan AsSpan() => new ReadOnlySpan(Value, Length);
public int Length { get; private set; }
@@ -49,7 +49,7 @@ public void Dispose()
public static implicit operator sbyte*(in MarshaledString value) => value.Value;
- public override string ToString()
+ public override readonly string ToString()
{
var span = new ReadOnlySpan(Value, Length);
return span.AsString();
diff --git a/sources/ClangSharp.Interop/Internals/MarshaledStringArray.cs b/sources/ClangSharp.Interop/Internals/MarshaledStringArray.cs
index 7f20c70a..c0b74151 100644
--- a/sources/ClangSharp.Interop/Internals/MarshaledStringArray.cs
+++ b/sources/ClangSharp.Interop/Internals/MarshaledStringArray.cs
@@ -25,7 +25,7 @@ public MarshaledStringArray(ReadOnlySpan inputs)
}
}
- public ReadOnlySpan Values => _values;
+ public readonly ReadOnlySpan Values => _values;
public void Dispose()
{
@@ -40,7 +40,7 @@ public void Dispose()
}
}
- public void Fill(sbyte** pDestination)
+ public readonly void Fill(sbyte** pDestination)
{
if (_values != null)
{
diff --git a/sources/ClangSharp.Interop/clang.cs b/sources/ClangSharp.Interop/clang.cs
new file mode 100644
index 00000000..47baef81
--- /dev/null
+++ b/sources/ClangSharp.Interop/clang.cs
@@ -0,0 +1,72 @@
+// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
+
+using System;
+using System.Linq;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+namespace ClangSharp.Interop;
+
+public static unsafe partial class @clang
+{
+ public static event DllImportResolver? ResolveLibrary;
+
+ static @clang()
+ {
+ if (!Configuration.DisableResolveLibraryHook)
+ {
+ NativeLibrary.SetDllImportResolver(Assembly.GetExecutingAssembly(), OnDllImport);
+ }
+ }
+
+ private static IntPtr OnDllImport(string libraryName, Assembly assembly, DllImportSearchPath? searchPath)
+ {
+ if (TryResolveLibrary(libraryName, assembly, searchPath, out var nativeLibrary))
+ {
+ return nativeLibrary;
+ }
+
+ if (libraryName.Equals("libclang") && TryResolveClang(assembly, searchPath, out nativeLibrary))
+ {
+ return nativeLibrary;
+ }
+
+ return IntPtr.Zero;
+ }
+
+ private static bool TryResolveClang(Assembly assembly, DllImportSearchPath? searchPath, out IntPtr nativeLibrary)
+ {
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ {
+ return NativeLibrary.TryLoad("libclang.so.16", assembly, searchPath, out nativeLibrary)
+ || NativeLibrary.TryLoad("libclang-16", assembly, searchPath, out nativeLibrary)
+ || NativeLibrary.TryLoad("libclang.so.1", assembly, searchPath, out nativeLibrary);
+ }
+
+ nativeLibrary = IntPtr.Zero;
+ return false;
+ }
+
+ private static bool TryResolveLibrary(string libraryName, Assembly assembly, DllImportSearchPath? searchPath, out IntPtr nativeLibrary)
+ {
+ var resolveLibrary = ResolveLibrary;
+
+ if (resolveLibrary is not null)
+ {
+ var resolvers = resolveLibrary.GetInvocationList().Cast();
+
+ foreach (DllImportResolver resolver in resolvers)
+ {
+ nativeLibrary = resolver(libraryName, assembly, searchPath);
+
+ if (nativeLibrary != IntPtr.Zero)
+ {
+ return true;
+ }
+ }
+ }
+
+ nativeLibrary = IntPtr.Zero;
+ return false;
+ }
+}
diff --git a/sources/ClangSharp.Interop/clang/clang.cs b/sources/ClangSharp.Interop/clang/clang.cs
index c4539224..1cb1431d 100644
--- a/sources/ClangSharp.Interop/clang/clang.cs
+++ b/sources/ClangSharp.Interop/clang/clang.cs
@@ -151,7 +151,7 @@ public static unsafe partial class @clang
public static extern uint getDiagnosticCategory([NativeTypeName("CXDiagnostic")] void* param0);
[DllImport("libclang", CallingConvention = CallingConvention.Cdecl, EntryPoint = "clang_getDiagnosticCategoryName", ExactSpelling = true)]
- [Obsolete]
+ [Obsolete("https://clang.llvm.org/doxygen/group__CINDEX__DIAG.html#gaf3d608c7860a57ce6571a3b03b4ead33")]
public static extern CXString getDiagnosticCategoryName([NativeTypeName("unsigned int")] uint Category);
[DllImport("libclang", CallingConvention = CallingConvention.Cdecl, EntryPoint = "clang_getDiagnosticCategoryText", ExactSpelling = true)]
diff --git a/sources/ClangSharp.PInvokeGenerator/Abstractions/EnumDesc.cs b/sources/ClangSharp.PInvokeGenerator/Abstractions/EnumDesc.cs
index 9dfd2cd7..57d5a8d2 100644
--- a/sources/ClangSharp.PInvokeGenerator/Abstractions/EnumDesc.cs
+++ b/sources/ClangSharp.PInvokeGenerator/Abstractions/EnumDesc.cs
@@ -14,7 +14,7 @@ public struct EnumDesc
public bool IsNested
{
- get
+ readonly get
{
return (Flags & EnumFlags.Nested) != 0;
}
diff --git a/sources/ClangSharp.PInvokeGenerator/Abstractions/FunctionOrDelegateDesc.cs b/sources/ClangSharp.PInvokeGenerator/Abstractions/FunctionOrDelegateDesc.cs
index 5bdbf137..555dae8f 100644
--- a/sources/ClangSharp.PInvokeGenerator/Abstractions/FunctionOrDelegateDesc.cs
+++ b/sources/ClangSharp.PInvokeGenerator/Abstractions/FunctionOrDelegateDesc.cs
@@ -25,7 +25,7 @@ internal struct FunctionOrDelegateDesc
public bool IsVirtual
{
- get
+ readonly get
{
return (Flags & FunctionOrDelegateFlags.IsVirtual) != 0;
}
@@ -38,7 +38,7 @@ public bool IsVirtual
public bool IsDllImport
{
- get
+ readonly get
{
return (Flags & FunctionOrDelegateFlags.IsDllImport) != 0;
}
@@ -53,7 +53,7 @@ public bool IsDllImport
public bool IsManualImport
{
- get
+ readonly get
{
return (Flags & FunctionOrDelegateFlags.IsManualImport) != 0;
}
@@ -68,7 +68,7 @@ public bool IsManualImport
public bool HasFnPtrCodeGen
{
- get
+ readonly get
{
return (Flags & FunctionOrDelegateFlags.HasFnPtrCodeGen) != 0;
}
@@ -83,7 +83,7 @@ public bool HasFnPtrCodeGen
public bool IsAggressivelyInlined
{
- get
+ readonly get
{
return (Flags & FunctionOrDelegateFlags.IsAggressivelyInlined) != 0;
}
@@ -98,7 +98,7 @@ public bool IsAggressivelyInlined
public bool SetLastError
{
- get
+ readonly get
{
return (Flags & FunctionOrDelegateFlags.SetLastError) != 0;
}
@@ -113,7 +113,7 @@ public bool SetLastError
public bool IsCxx
{
- get
+ readonly get
{
return (Flags & FunctionOrDelegateFlags.IsCxx) != 0;
}
@@ -126,7 +126,7 @@ public bool IsCxx
public bool NeedsNewKeyword
{
- get
+ readonly get
{
return (Flags & FunctionOrDelegateFlags.NeedsNewKeyword) != 0;
}
@@ -141,7 +141,7 @@ public bool NeedsNewKeyword
public bool IsUnsafe
{
- get
+ readonly get
{
return (Flags & FunctionOrDelegateFlags.IsUnsafe) != 0;
}
@@ -154,7 +154,7 @@ public bool IsUnsafe
public bool IsCtxCxxRecord
{
- get
+ readonly get
{
return (Flags & FunctionOrDelegateFlags.IsCtxCxxRecord) != 0;
}
@@ -169,7 +169,7 @@ public bool IsCtxCxxRecord
public bool IsCxxRecordCtxUnsafe
{
- get
+ readonly get
{
return (Flags & FunctionOrDelegateFlags.IsCxxRecordCtxUnsafe) != 0;
}
@@ -184,7 +184,7 @@ public bool IsCxxRecordCtxUnsafe
public bool IsMemberFunction
{
- get
+ readonly get
{
return (Flags & FunctionOrDelegateFlags.IsMemberFunction) != 0;
}
@@ -199,7 +199,7 @@ public bool IsMemberFunction
public bool? IsStatic
{
- get
+ readonly get
{
return (Flags & FunctionOrDelegateFlags.IsStatic) != 0
? true
@@ -219,7 +219,7 @@ public bool? IsStatic
public bool NeedsReturnFixup
{
- get
+ readonly get
{
return (Flags & FunctionOrDelegateFlags.NeedsReturnFixup) != 0;
}
@@ -234,7 +234,7 @@ public bool NeedsReturnFixup
public bool IsCxxConstructor
{
- get
+ readonly get
{
return (Flags & FunctionOrDelegateFlags.IsCxxConstructor) != 0;
}
diff --git a/sources/ClangSharp.PInvokeGenerator/Abstractions/StructDesc.cs b/sources/ClangSharp.PInvokeGenerator/Abstractions/StructDesc.cs
index a63b3c65..60357236 100644
--- a/sources/ClangSharp.PInvokeGenerator/Abstractions/StructDesc.cs
+++ b/sources/ClangSharp.PInvokeGenerator/Abstractions/StructDesc.cs
@@ -20,7 +20,7 @@ internal struct StructDesc
public bool IsNested
{
- get
+ readonly get
{
return (Flags & StructFlags.Nested) != 0;
}
@@ -33,7 +33,7 @@ public bool IsNested
public bool IsUnsafe
{
- get
+ readonly get
{
return (Flags & StructFlags.Unsafe) != 0;
}
@@ -46,7 +46,7 @@ public bool IsUnsafe
public bool HasVtbl
{
- get
+ readonly get
{
return (Flags & StructFlags.Vtbl) != 0;
}
@@ -59,7 +59,7 @@ public bool HasVtbl
public bool IsUnion
{
- get
+ readonly get
{
return (Flags & StructFlags.Union) != 0;
}
@@ -73,7 +73,7 @@ public bool IsUnion
public Action