Skip to content

Commit c61c989

Browse files
committed
Added an option for specifying STD types to bind.
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 291da4e commit c61c989

File tree

17 files changed

+490
-187
lines changed

17 files changed

+490
-187
lines changed

src/CppParser/Bindings/CLI/CppParser.cpp

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,25 @@ void CppSharp::Parser::CppParserOptions::ClearLibraryDirs()
166166
((::CppSharp::CppParser::CppParserOptions*)NativePtr)->clearLibraryDirs();
167167
}
168168

169+
System::String^ CppSharp::Parser::CppParserOptions::GetSupportedStdTypes(unsigned int i)
170+
{
171+
auto __ret = ((::CppSharp::CppParser::CppParserOptions*)NativePtr)->getSupportedStdTypes(i);
172+
if (__ret == nullptr) return nullptr;
173+
return (__ret == 0 ? nullptr : clix::marshalString<clix::E_UTF8>(__ret));
174+
}
175+
176+
void CppSharp::Parser::CppParserOptions::AddSupportedStdTypes(System::String^ s)
177+
{
178+
auto ___arg0 = clix::marshalString<clix::E_UTF8>(s);
179+
auto __arg0 = ___arg0.c_str();
180+
((::CppSharp::CppParser::CppParserOptions*)NativePtr)->addSupportedStdTypes(__arg0);
181+
}
182+
183+
void CppSharp::Parser::CppParserOptions::ClearSupportedStdTypes()
184+
{
185+
((::CppSharp::CppParser::CppParserOptions*)NativePtr)->clearSupportedStdTypes();
186+
}
187+
169188
CppSharp::Parser::CppParserOptions::CppParserOptions(CppSharp::Parser::CppParserOptions^ _0)
170189
{
171190
__ownsNativeInstance = true;
@@ -349,6 +368,28 @@ void CppSharp::Parser::CppParserOptions::LibraryDirs::set(System::Collections::G
349368
((::CppSharp::CppParser::CppParserOptions*)NativePtr)->LibraryDirs = _tmpvalue;
350369
}
351370

371+
System::Collections::Generic::List<System::String^>^ CppSharp::Parser::CppParserOptions::SupportedStdTypes::get()
372+
{
373+
auto _tmp__SupportedStdTypes = gcnew System::Collections::Generic::List<System::String^>();
374+
for(auto _element : ((::CppSharp::CppParser::CppParserOptions*)NativePtr)->SupportedStdTypes)
375+
{
376+
auto _marshalElement = clix::marshalString<clix::E_UTF8>(_element);
377+
_tmp__SupportedStdTypes->Add(_marshalElement);
378+
}
379+
return _tmp__SupportedStdTypes;
380+
}
381+
382+
void CppSharp::Parser::CppParserOptions::SupportedStdTypes::set(System::Collections::Generic::List<System::String^>^ value)
383+
{
384+
auto _tmpvalue = std::vector<::std::string>();
385+
for each(System::String^ _element in value)
386+
{
387+
auto _marshalElement = clix::marshalString<clix::E_UTF8>(_element);
388+
_tmpvalue.push_back(_marshalElement);
389+
}
390+
((::CppSharp::CppParser::CppParserOptions*)NativePtr)->SupportedStdTypes = _tmpvalue;
391+
}
392+
352393
CppSharp::Parser::AST::ASTContext^ CppSharp::Parser::CppParserOptions::ASTContext::get()
353394
{
354395
return (((::CppSharp::CppParser::CppParserOptions*)NativePtr)->ASTContext == nullptr) ? nullptr : gcnew CppSharp::Parser::AST::ASTContext((::CppSharp::CppParser::AST::ASTContext*)((::CppSharp::CppParser::CppParserOptions*)NativePtr)->ASTContext);
@@ -491,6 +532,12 @@ unsigned int CppSharp::Parser::CppParserOptions::LibraryDirsCount::get()
491532
return __ret;
492533
}
493534

535+
unsigned int CppSharp::Parser::CppParserOptions::SupportedStdTypesCount::get()
536+
{
537+
auto __ret = ((::CppSharp::CppParser::CppParserOptions*)NativePtr)->getSupportedStdTypesCount();
538+
return __ret;
539+
}
540+
494541
CppSharp::Parser::ParserDiagnostic::ParserDiagnostic(::CppSharp::CppParser::ParserDiagnostic* native)
495542
: __ownsNativeInstance(false)
496543
{

src/CppParser/Bindings/CLI/CppParser.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ namespace CppSharp
127127
void set(System::Collections::Generic::List<System::String^>^);
128128
}
129129

130+
property System::Collections::Generic::List<System::String^>^ SupportedStdTypes
131+
{
132+
System::Collections::Generic::List<System::String^>^ get();
133+
void set(System::Collections::Generic::List<System::String^>^);
134+
}
135+
130136
property CppSharp::Parser::AST::ASTContext^ ASTContext
131137
{
132138
CppSharp::Parser::AST::ASTContext^ get();
@@ -222,6 +228,11 @@ namespace CppSharp
222228
unsigned int get();
223229
}
224230

231+
property unsigned int SupportedStdTypesCount
232+
{
233+
unsigned int get();
234+
}
235+
225236
System::String^ GetArguments(unsigned int i);
226237

227238
void AddArguments(System::String^ s);
@@ -264,6 +275,12 @@ namespace CppSharp
264275

265276
void ClearLibraryDirs();
266277

278+
System::String^ GetSupportedStdTypes(unsigned int i);
279+
280+
void AddSupportedStdTypes(System::String^ s);
281+
282+
void ClearSupportedStdTypes();
283+
267284
protected:
268285
bool __ownsNativeInstance;
269286
};

src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17948,7 +17948,7 @@ protected Parser(void* native, bool skipVTables = false)
1794817948

1794917949
public unsafe partial class CppParserOptions : IDisposable
1795017950
{
17951-
[StructLayout(LayoutKind.Explicit, Size = 140)]
17951+
[StructLayout(LayoutKind.Explicit, Size = 152)]
1795217952
public partial struct __Internal
1795317953
{
1795417954
[FieldOffset(0)]
@@ -17976,33 +17976,36 @@ public partial struct __Internal
1797617976
internal global::Std.Vector.__Internal LibraryDirs;
1797717977

1797817978
[FieldOffset(96)]
17979+
internal global::Std.Vector.__Internal SupportedStdTypes;
17980+
17981+
[FieldOffset(108)]
1797917982
internal global::System.IntPtr ASTContext;
1798017983

17981-
[FieldOffset(100)]
17984+
[FieldOffset(112)]
1798217985
internal int toolSetToUse;
1798317986

17984-
[FieldOffset(104)]
17987+
[FieldOffset(116)]
1798517988
internal global::Std.BasicString.__Internal targetTriple;
1798617989

17987-
[FieldOffset(116)]
17990+
[FieldOffset(128)]
1798817991
internal global::Std.BasicString.__Internal currentDir;
1798917992

17990-
[FieldOffset(128)]
17993+
[FieldOffset(140)]
1799117994
internal global::CppSharp.Parser.AST.CppAbi abi;
1799217995

17993-
[FieldOffset(132)]
17996+
[FieldOffset(144)]
1799417997
internal byte noStandardIncludes;
1799517998

17996-
[FieldOffset(133)]
17999+
[FieldOffset(145)]
1799718000
internal byte noBuiltinIncludes;
1799818001

17999-
[FieldOffset(134)]
18002+
[FieldOffset(146)]
1800018003
internal byte microsoftMode;
1800118004

18002-
[FieldOffset(135)]
18005+
[FieldOffset(147)]
1800318006
internal byte verbose;
1800418007

18005-
[FieldOffset(136)]
18008+
[FieldOffset(148)]
1800618009
internal global::System.IntPtr targetInfo;
1800718010

1800818011
[SuppressUnmanagedCodeSecurity]
@@ -18125,6 +18128,21 @@ public partial struct __Internal
1812518128
EntryPoint="_ZN8CppSharp9CppParser16CppParserOptions16clearLibraryDirsEv")]
1812618129
internal static extern void ClearLibraryDirs(global::System.IntPtr instance);
1812718130

18131+
[SuppressUnmanagedCodeSecurity]
18132+
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
18133+
EntryPoint="_ZN8CppSharp9CppParser16CppParserOptions20getSupportedStdTypesEj")]
18134+
internal static extern global::System.IntPtr GetSupportedStdTypes(global::System.IntPtr instance, uint i);
18135+
18136+
[SuppressUnmanagedCodeSecurity]
18137+
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
18138+
EntryPoint="_ZN8CppSharp9CppParser16CppParserOptions20addSupportedStdTypesEPKc")]
18139+
internal static extern void AddSupportedStdTypes(global::System.IntPtr instance, [MarshalAs(UnmanagedType.LPStr)] string s);
18140+
18141+
[SuppressUnmanagedCodeSecurity]
18142+
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
18143+
EntryPoint="_ZN8CppSharp9CppParser16CppParserOptions22clearSupportedStdTypesEv")]
18144+
internal static extern void ClearSupportedStdTypes(global::System.IntPtr instance);
18145+
1812818146
[SuppressUnmanagedCodeSecurity]
1812918147
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
1813018148
EntryPoint="_ZN8CppSharp9CppParser16CppParserOptions17getArgumentsCountEv")]
@@ -18159,6 +18177,11 @@ public partial struct __Internal
1815918177
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
1816018178
EntryPoint="_ZN8CppSharp9CppParser16CppParserOptions19getLibraryDirsCountEv")]
1816118179
internal static extern uint GetLibraryDirsCount(global::System.IntPtr instance);
18180+
18181+
[SuppressUnmanagedCodeSecurity]
18182+
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
18183+
EntryPoint="_ZN8CppSharp9CppParser16CppParserOptions25getSupportedStdTypesCountEv")]
18184+
internal static extern uint GetSupportedStdTypesCount(global::System.IntPtr instance);
1816218185
}
1816318186

1816418187
public global::System.IntPtr __Instance { get; protected set; }
@@ -18349,6 +18372,22 @@ public void ClearLibraryDirs()
1834918372
__Internal.ClearLibraryDirs((__Instance + __PointerAdjustment));
1835018373
}
1835118374

18375+
public string GetSupportedStdTypes(uint i)
18376+
{
18377+
var __ret = __Internal.GetSupportedStdTypes((__Instance + __PointerAdjustment), i);
18378+
return Marshal.PtrToStringAnsi(__ret);
18379+
}
18380+
18381+
public void AddSupportedStdTypes(string s)
18382+
{
18383+
__Internal.AddSupportedStdTypes((__Instance + __PointerAdjustment), s);
18384+
}
18385+
18386+
public void ClearSupportedStdTypes()
18387+
{
18388+
__Internal.ClearSupportedStdTypes((__Instance + __PointerAdjustment));
18389+
}
18390+
1835218391
public string LibraryFile
1835318392
{
1835418393
get
@@ -18579,6 +18618,15 @@ public uint LibraryDirsCount
1857918618
return __ret;
1858018619
}
1858118620
}
18621+
18622+
public uint SupportedStdTypesCount
18623+
{
18624+
get
18625+
{
18626+
var __ret = __Internal.GetSupportedStdTypesCount((__Instance + __PointerAdjustment));
18627+
return __ret;
18628+
}
18629+
}
1858218630
}
1858318631

1858418632
public unsafe partial class ParserDiagnostic : IDisposable

src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Std.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,6 @@ public unsafe partial struct __Internal
248248
[FieldOffset(0)]
249249
internal global::Std.Tree.__Internal __tree_;
250250
}
251-
252-
253-
public unsafe partial class ValueCompare
254-
{
255-
[StructLayout(LayoutKind.Explicit, Size = 0)]
256-
public partial struct __Internal
257-
{
258-
}
259-
}
260251
}
261252

262253
public unsafe partial class Map<_Key, _Tp, _Compare, _Allocator>

src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17948,7 +17948,7 @@ protected Parser(void* native, bool skipVTables = false)
1794817948

1794917949
public unsafe partial class CppParserOptions : IDisposable
1795017950
{
17951-
[StructLayout(LayoutKind.Explicit, Size = 176)]
17951+
[StructLayout(LayoutKind.Explicit, Size = 188)]
1795217952
public partial struct __Internal
1795317953
{
1795417954
[FieldOffset(0)]
@@ -17976,33 +17976,36 @@ public partial struct __Internal
1797617976
internal global::Std.Vector.__Internal LibraryDirs;
1797717977

1797817978
[FieldOffset(108)]
17979+
internal global::Std.Vector.__Internal SupportedStdTypes;
17980+
17981+
[FieldOffset(120)]
1797917982
internal global::System.IntPtr ASTContext;
1798017983

17981-
[FieldOffset(112)]
17984+
[FieldOffset(124)]
1798217985
internal int toolSetToUse;
1798317986

17984-
[FieldOffset(116)]
17987+
[FieldOffset(128)]
1798517988
internal global::Std.BasicString.__Internal targetTriple;
1798617989

17987-
[FieldOffset(140)]
17990+
[FieldOffset(152)]
1798817991
internal global::Std.BasicString.__Internal currentDir;
1798917992

17990-
[FieldOffset(164)]
17993+
[FieldOffset(176)]
1799117994
internal global::CppSharp.Parser.AST.CppAbi abi;
1799217995

17993-
[FieldOffset(168)]
17996+
[FieldOffset(180)]
1799417997
internal byte noStandardIncludes;
1799517998

17996-
[FieldOffset(169)]
17999+
[FieldOffset(181)]
1799718000
internal byte noBuiltinIncludes;
1799818001

17999-
[FieldOffset(170)]
18002+
[FieldOffset(182)]
1800018003
internal byte microsoftMode;
1800118004

18002-
[FieldOffset(171)]
18005+
[FieldOffset(183)]
1800318006
internal byte verbose;
1800418007

18005-
[FieldOffset(172)]
18008+
[FieldOffset(184)]
1800618009
internal global::System.IntPtr targetInfo;
1800718010

1800818011
[SuppressUnmanagedCodeSecurity]
@@ -18125,6 +18128,21 @@ public partial struct __Internal
1812518128
EntryPoint="?clearLibraryDirs@CppParserOptions@CppParser@CppSharp@@QAEXXZ")]
1812618129
internal static extern void ClearLibraryDirs(global::System.IntPtr instance);
1812718130

18131+
[SuppressUnmanagedCodeSecurity]
18132+
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
18133+
EntryPoint="?getSupportedStdTypes@CppParserOptions@CppParser@CppSharp@@QAEPBDI@Z")]
18134+
internal static extern global::System.IntPtr GetSupportedStdTypes(global::System.IntPtr instance, uint i);
18135+
18136+
[SuppressUnmanagedCodeSecurity]
18137+
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
18138+
EntryPoint="?addSupportedStdTypes@CppParserOptions@CppParser@CppSharp@@QAEXPBD@Z")]
18139+
internal static extern void AddSupportedStdTypes(global::System.IntPtr instance, [MarshalAs(UnmanagedType.LPStr)] string s);
18140+
18141+
[SuppressUnmanagedCodeSecurity]
18142+
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
18143+
EntryPoint="?clearSupportedStdTypes@CppParserOptions@CppParser@CppSharp@@QAEXXZ")]
18144+
internal static extern void ClearSupportedStdTypes(global::System.IntPtr instance);
18145+
1812818146
[SuppressUnmanagedCodeSecurity]
1812918147
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
1813018148
EntryPoint="?getArgumentsCount@CppParserOptions@CppParser@CppSharp@@QAEIXZ")]
@@ -18159,6 +18177,11 @@ public partial struct __Internal
1815918177
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
1816018178
EntryPoint="?getLibraryDirsCount@CppParserOptions@CppParser@CppSharp@@QAEIXZ")]
1816118179
internal static extern uint GetLibraryDirsCount(global::System.IntPtr instance);
18180+
18181+
[SuppressUnmanagedCodeSecurity]
18182+
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
18183+
EntryPoint="?getSupportedStdTypesCount@CppParserOptions@CppParser@CppSharp@@QAEIXZ")]
18184+
internal static extern uint GetSupportedStdTypesCount(global::System.IntPtr instance);
1816218185
}
1816318186

1816418187
public global::System.IntPtr __Instance { get; protected set; }
@@ -18349,6 +18372,22 @@ public void ClearLibraryDirs()
1834918372
__Internal.ClearLibraryDirs((__Instance + __PointerAdjustment));
1835018373
}
1835118374

18375+
public string GetSupportedStdTypes(uint i)
18376+
{
18377+
var __ret = __Internal.GetSupportedStdTypes((__Instance + __PointerAdjustment), i);
18378+
return Marshal.PtrToStringAnsi(__ret);
18379+
}
18380+
18381+
public void AddSupportedStdTypes(string s)
18382+
{
18383+
__Internal.AddSupportedStdTypes((__Instance + __PointerAdjustment), s);
18384+
}
18385+
18386+
public void ClearSupportedStdTypes()
18387+
{
18388+
__Internal.ClearSupportedStdTypes((__Instance + __PointerAdjustment));
18389+
}
18390+
1835218391
public string LibraryFile
1835318392
{
1835418393
get
@@ -18579,6 +18618,15 @@ public uint LibraryDirsCount
1857918618
return __ret;
1858018619
}
1858118620
}
18621+
18622+
public uint SupportedStdTypesCount
18623+
{
18624+
get
18625+
{
18626+
var __ret = __Internal.GetSupportedStdTypesCount((__Instance + __PointerAdjustment));
18627+
return __ret;
18628+
}
18629+
}
1858218630
}
1858318631

1858418632
public unsafe partial class ParserDiagnostic : IDisposable

0 commit comments

Comments
 (0)