mirror of https://github.com/mono/CppSharp.git
Browse Source
Normalized all the line endings with: git rm --cached -r . git reset --hard git add . git commit -m "Normalize all the line endings" Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>pull/249/head
31 changed files with 7749 additions and 7749 deletions
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,439 +1,439 @@
@@ -1,439 +1,439 @@
|
||||
#include "CppParser.h" |
||||
#include "AST.h" |
||||
#include "Target.h" |
||||
|
||||
using namespace System; |
||||
using namespace System::Runtime::InteropServices; |
||||
|
||||
CppSharp::Parser::ParserOptions::ParserOptions(::CppSharp::CppParser::ParserOptions* native) |
||||
{ |
||||
NativePtr = native; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserOptions::ParserOptions(System::IntPtr native) |
||||
{ |
||||
auto __native = (::CppSharp::CppParser::ParserOptions*)native.ToPointer(); |
||||
NativePtr = __native; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserOptions::ParserOptions() |
||||
{ |
||||
NativePtr = new ::CppSharp::CppParser::ParserOptions(); |
||||
} |
||||
|
||||
System::String^ CppSharp::Parser::ParserOptions::getArguments(unsigned int i) |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getArguments(i); |
||||
if (__ret == nullptr) return nullptr; |
||||
return clix::marshalString<clix::E_UTF8>(__ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::addArguments(System::String^ s) |
||||
{ |
||||
auto _arg0 = clix::marshalString<clix::E_UTF8>(s); |
||||
auto arg0 = _arg0.c_str(); |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->addArguments(arg0); |
||||
} |
||||
|
||||
System::String^ CppSharp::Parser::ParserOptions::getIncludeDirs(unsigned int i) |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getIncludeDirs(i); |
||||
if (__ret == nullptr) return nullptr; |
||||
return clix::marshalString<clix::E_UTF8>(__ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::addIncludeDirs(System::String^ s) |
||||
{ |
||||
auto _arg0 = clix::marshalString<clix::E_UTF8>(s); |
||||
auto arg0 = _arg0.c_str(); |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->addIncludeDirs(arg0); |
||||
} |
||||
|
||||
System::String^ CppSharp::Parser::ParserOptions::getSystemIncludeDirs(unsigned int i) |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getSystemIncludeDirs(i); |
||||
if (__ret == nullptr) return nullptr; |
||||
return clix::marshalString<clix::E_UTF8>(__ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::addSystemIncludeDirs(System::String^ s) |
||||
{ |
||||
auto _arg0 = clix::marshalString<clix::E_UTF8>(s); |
||||
auto arg0 = _arg0.c_str(); |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->addSystemIncludeDirs(arg0); |
||||
} |
||||
|
||||
System::String^ CppSharp::Parser::ParserOptions::getDefines(unsigned int i) |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getDefines(i); |
||||
if (__ret == nullptr) return nullptr; |
||||
return clix::marshalString<clix::E_UTF8>(__ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::addDefines(System::String^ s) |
||||
{ |
||||
auto _arg0 = clix::marshalString<clix::E_UTF8>(s); |
||||
auto arg0 = _arg0.c_str(); |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->addDefines(arg0); |
||||
} |
||||
|
||||
System::String^ CppSharp::Parser::ParserOptions::getLibraryDirs(unsigned int i) |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getLibraryDirs(i); |
||||
if (__ret == nullptr) return nullptr; |
||||
return clix::marshalString<clix::E_UTF8>(__ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::addLibraryDirs(System::String^ s) |
||||
{ |
||||
auto _arg0 = clix::marshalString<clix::E_UTF8>(s); |
||||
auto arg0 = _arg0.c_str(); |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->addLibraryDirs(arg0); |
||||
} |
||||
|
||||
System::IntPtr CppSharp::Parser::ParserOptions::__Instance::get() |
||||
{ |
||||
return System::IntPtr(NativePtr); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::__Instance::set(System::IntPtr object) |
||||
{ |
||||
NativePtr = (::CppSharp::CppParser::ParserOptions*)object.ToPointer(); |
||||
} |
||||
|
||||
unsigned int CppSharp::Parser::ParserOptions::ArgumentsCount::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getArgumentsCount(); |
||||
return __ret; |
||||
} |
||||
|
||||
System::String^ CppSharp::Parser::ParserOptions::FileName::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getFileName(); |
||||
if (__ret == nullptr) return nullptr; |
||||
return clix::marshalString<clix::E_UTF8>(__ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::FileName::set(System::String^ s) |
||||
{ |
||||
auto _arg0 = clix::marshalString<clix::E_UTF8>(s); |
||||
auto arg0 = _arg0.c_str(); |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->setFileName(arg0); |
||||
} |
||||
|
||||
unsigned int CppSharp::Parser::ParserOptions::IncludeDirsCount::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getIncludeDirsCount(); |
||||
return __ret; |
||||
} |
||||
|
||||
unsigned int CppSharp::Parser::ParserOptions::SystemIncludeDirsCount::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getSystemIncludeDirsCount(); |
||||
return __ret; |
||||
} |
||||
|
||||
unsigned int CppSharp::Parser::ParserOptions::DefinesCount::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getDefinesCount(); |
||||
return __ret; |
||||
} |
||||
|
||||
unsigned int CppSharp::Parser::ParserOptions::LibraryDirsCount::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getLibraryDirsCount(); |
||||
return __ret; |
||||
} |
||||
|
||||
System::String^ CppSharp::Parser::ParserOptions::TargetTriple::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getTargetTriple(); |
||||
if (__ret == nullptr) return nullptr; |
||||
return clix::marshalString<clix::E_UTF8>(__ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::TargetTriple::set(System::String^ s) |
||||
{ |
||||
auto _arg0 = clix::marshalString<clix::E_UTF8>(s); |
||||
auto arg0 = _arg0.c_str(); |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->setTargetTriple(arg0); |
||||
} |
||||
|
||||
CppSharp::Parser::AST::ASTContext^ CppSharp::Parser::ParserOptions::ASTContext::get() |
||||
{ |
||||
return (((::CppSharp::CppParser::ParserOptions*)NativePtr)->ASTContext == nullptr) ? nullptr : gcnew CppSharp::Parser::AST::ASTContext((::CppSharp::CppParser::AST::ASTContext*)((::CppSharp::CppParser::ParserOptions*)NativePtr)->ASTContext); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::ASTContext::set(CppSharp::Parser::AST::ASTContext^ value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->ASTContext = (::CppSharp::CppParser::AST::ASTContext*)value->NativePtr; |
||||
} |
||||
|
||||
int CppSharp::Parser::ParserOptions::ToolSetToUse::get() |
||||
{ |
||||
return ((::CppSharp::CppParser::ParserOptions*)NativePtr)->ToolSetToUse; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::ToolSetToUse::set(int value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->ToolSetToUse = value; |
||||
} |
||||
|
||||
CppSharp::Parser::AST::CppAbi CppSharp::Parser::ParserOptions::Abi::get() |
||||
{ |
||||
return (CppSharp::Parser::AST::CppAbi)((::CppSharp::CppParser::ParserOptions*)NativePtr)->Abi; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::Abi::set(CppSharp::Parser::AST::CppAbi value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->Abi = (::CppSharp::CppParser::AST::CppAbi)value; |
||||
} |
||||
|
||||
bool CppSharp::Parser::ParserOptions::NoStandardIncludes::get() |
||||
{ |
||||
return ((::CppSharp::CppParser::ParserOptions*)NativePtr)->NoStandardIncludes; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::NoStandardIncludes::set(bool value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->NoStandardIncludes = value; |
||||
} |
||||
|
||||
bool CppSharp::Parser::ParserOptions::NoBuiltinIncludes::get() |
||||
{ |
||||
return ((::CppSharp::CppParser::ParserOptions*)NativePtr)->NoBuiltinIncludes; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::NoBuiltinIncludes::set(bool value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->NoBuiltinIncludes = value; |
||||
} |
||||
|
||||
bool CppSharp::Parser::ParserOptions::MicrosoftMode::get() |
||||
{ |
||||
return ((::CppSharp::CppParser::ParserOptions*)NativePtr)->MicrosoftMode; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::MicrosoftMode::set(bool value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->MicrosoftMode = value; |
||||
} |
||||
|
||||
bool CppSharp::Parser::ParserOptions::Verbose::get() |
||||
{ |
||||
return ((::CppSharp::CppParser::ParserOptions*)NativePtr)->Verbose; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::Verbose::set(bool value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->Verbose = value; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserDiagnostic::ParserDiagnostic(::CppSharp::CppParser::ParserDiagnostic* native) |
||||
{ |
||||
NativePtr = native; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserDiagnostic::ParserDiagnostic(System::IntPtr native) |
||||
{ |
||||
auto __native = (::CppSharp::CppParser::ParserDiagnostic*)native.ToPointer(); |
||||
NativePtr = __native; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserDiagnostic::ParserDiagnostic() |
||||
{ |
||||
NativePtr = new ::CppSharp::CppParser::ParserDiagnostic(); |
||||
} |
||||
|
||||
System::IntPtr CppSharp::Parser::ParserDiagnostic::__Instance::get() |
||||
{ |
||||
return System::IntPtr(NativePtr); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserDiagnostic::__Instance::set(System::IntPtr object) |
||||
{ |
||||
NativePtr = (::CppSharp::CppParser::ParserDiagnostic*)object.ToPointer(); |
||||
} |
||||
|
||||
System::String^ CppSharp::Parser::ParserDiagnostic::FileName::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->getFileName(); |
||||
if (__ret == nullptr) return nullptr; |
||||
return clix::marshalString<clix::E_UTF8>(__ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserDiagnostic::FileName::set(System::String^ s) |
||||
{ |
||||
auto _arg0 = clix::marshalString<clix::E_UTF8>(s); |
||||
auto arg0 = _arg0.c_str(); |
||||
((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->setFileName(arg0); |
||||
} |
||||
|
||||
System::String^ CppSharp::Parser::ParserDiagnostic::Message::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->getMessage(); |
||||
if (__ret == nullptr) return nullptr; |
||||
return clix::marshalString<clix::E_UTF8>(__ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserDiagnostic::Message::set(System::String^ s) |
||||
{ |
||||
auto _arg0 = clix::marshalString<clix::E_UTF8>(s); |
||||
auto arg0 = _arg0.c_str(); |
||||
((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->setMessage(arg0); |
||||
} |
||||
|
||||
CppSharp::Parser::ParserDiagnosticLevel CppSharp::Parser::ParserDiagnostic::Level::get() |
||||
{ |
||||
return (CppSharp::Parser::ParserDiagnosticLevel)((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->Level; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserDiagnostic::Level::set(CppSharp::Parser::ParserDiagnosticLevel value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->Level = (::CppSharp::CppParser::ParserDiagnosticLevel)value; |
||||
} |
||||
|
||||
int CppSharp::Parser::ParserDiagnostic::LineNumber::get() |
||||
{ |
||||
return ((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->LineNumber; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserDiagnostic::LineNumber::set(int value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->LineNumber = value; |
||||
} |
||||
|
||||
int CppSharp::Parser::ParserDiagnostic::ColumnNumber::get() |
||||
{ |
||||
return ((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->ColumnNumber; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserDiagnostic::ColumnNumber::set(int value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->ColumnNumber = value; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserResult::ParserResult(::CppSharp::CppParser::ParserResult* native) |
||||
{ |
||||
NativePtr = native; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserResult::ParserResult(System::IntPtr native) |
||||
{ |
||||
auto __native = (::CppSharp::CppParser::ParserResult*)native.ToPointer(); |
||||
NativePtr = __native; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserResult::ParserResult() |
||||
{ |
||||
NativePtr = new ::CppSharp::CppParser::ParserResult(); |
||||
} |
||||
|
||||
CppSharp::Parser::ParserDiagnostic^ CppSharp::Parser::ParserResult::getDiagnostics(unsigned int i) |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserResult*)NativePtr)->getDiagnostics(i); |
||||
auto ____ret = new ::CppSharp::CppParser::ParserDiagnostic(__ret); |
||||
return (____ret == nullptr) ? nullptr : gcnew CppSharp::Parser::ParserDiagnostic((::CppSharp::CppParser::ParserDiagnostic*)____ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserResult::addDiagnostics(CppSharp::Parser::ParserDiagnostic^ s) |
||||
{ |
||||
auto &arg0 = *(::CppSharp::CppParser::ParserDiagnostic*)s->NativePtr; |
||||
((::CppSharp::CppParser::ParserResult*)NativePtr)->addDiagnostics(arg0); |
||||
} |
||||
|
||||
System::IntPtr CppSharp::Parser::ParserResult::__Instance::get() |
||||
{ |
||||
return System::IntPtr(NativePtr); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserResult::__Instance::set(System::IntPtr object) |
||||
{ |
||||
NativePtr = (::CppSharp::CppParser::ParserResult*)object.ToPointer(); |
||||
} |
||||
|
||||
unsigned int CppSharp::Parser::ParserResult::DiagnosticsCount::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserResult*)NativePtr)->getDiagnosticsCount(); |
||||
return __ret; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserResultKind CppSharp::Parser::ParserResult::Kind::get() |
||||
{ |
||||
return (CppSharp::Parser::ParserResultKind)((::CppSharp::CppParser::ParserResult*)NativePtr)->Kind; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserResult::Kind::set(CppSharp::Parser::ParserResultKind value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserResult*)NativePtr)->Kind = (::CppSharp::CppParser::ParserResultKind)value; |
||||
} |
||||
|
||||
CppSharp::Parser::AST::ASTContext^ CppSharp::Parser::ParserResult::ASTContext::get() |
||||
{ |
||||
return (((::CppSharp::CppParser::ParserResult*)NativePtr)->ASTContext == nullptr) ? nullptr : gcnew CppSharp::Parser::AST::ASTContext((::CppSharp::CppParser::AST::ASTContext*)((::CppSharp::CppParser::ParserResult*)NativePtr)->ASTContext); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserResult::ASTContext::set(CppSharp::Parser::AST::ASTContext^ value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserResult*)NativePtr)->ASTContext = (::CppSharp::CppParser::AST::ASTContext*)value->NativePtr; |
||||
} |
||||
|
||||
CppSharp::Parser::AST::NativeLibrary^ CppSharp::Parser::ParserResult::Library::get() |
||||
{ |
||||
return (((::CppSharp::CppParser::ParserResult*)NativePtr)->Library == nullptr) ? nullptr : gcnew CppSharp::Parser::AST::NativeLibrary((::CppSharp::CppParser::AST::NativeLibrary*)((::CppSharp::CppParser::ParserResult*)NativePtr)->Library); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserResult::Library::set(CppSharp::Parser::AST::NativeLibrary^ value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserResult*)NativePtr)->Library = (::CppSharp::CppParser::AST::NativeLibrary*)value->NativePtr; |
||||
} |
||||
|
||||
CppSharp::Parser::ClangParser::ClangParser(::CppSharp::CppParser::ClangParser* native) |
||||
{ |
||||
NativePtr = native; |
||||
} |
||||
|
||||
CppSharp::Parser::ClangParser::ClangParser(System::IntPtr native) |
||||
{ |
||||
auto __native = (::CppSharp::CppParser::ClangParser*)native.ToPointer(); |
||||
NativePtr = __native; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserResult^ CppSharp::Parser::ClangParser::ParseHeader(CppSharp::Parser::ParserOptions^ Opts) |
||||
{ |
||||
auto arg0 = (::CppSharp::CppParser::ParserOptions*)Opts->NativePtr; |
||||
auto __ret = ::CppSharp::CppParser::ClangParser::ParseHeader(arg0); |
||||
if (__ret == nullptr) return nullptr; |
||||
return (__ret == nullptr) ? nullptr : gcnew CppSharp::Parser::ParserResult((::CppSharp::CppParser::ParserResult*)__ret); |
||||
} |
||||
|
||||
CppSharp::Parser::ParserResult^ CppSharp::Parser::ClangParser::ParseLibrary(CppSharp::Parser::ParserOptions^ Opts) |
||||
{ |
||||
auto arg0 = (::CppSharp::CppParser::ParserOptions*)Opts->NativePtr; |
||||
auto __ret = ::CppSharp::CppParser::ClangParser::ParseLibrary(arg0); |
||||
if (__ret == nullptr) return nullptr; |
||||
return (__ret == nullptr) ? nullptr : gcnew CppSharp::Parser::ParserResult((::CppSharp::CppParser::ParserResult*)__ret); |
||||
} |
||||
|
||||
CppSharp::Parser::ParserTargetInfo^ CppSharp::Parser::ClangParser::GetTargetInfo(CppSharp::Parser::ParserOptions^ Opts) |
||||
{ |
||||
auto arg0 = (::CppSharp::CppParser::ParserOptions*)Opts->NativePtr; |
||||
auto __ret = ::CppSharp::CppParser::ClangParser::GetTargetInfo(arg0); |
||||
if (__ret == nullptr) return nullptr; |
||||
return (__ret == nullptr) ? nullptr : gcnew CppSharp::Parser::ParserTargetInfo((::CppSharp::CppParser::ParserTargetInfo*)__ret); |
||||
} |
||||
|
||||
CppSharp::Parser::ClangParser::ClangParser() |
||||
{ |
||||
NativePtr = new ::CppSharp::CppParser::ClangParser(); |
||||
} |
||||
|
||||
System::IntPtr CppSharp::Parser::ClangParser::__Instance::get() |
||||
{ |
||||
return System::IntPtr(NativePtr); |
||||
} |
||||
|
||||
void CppSharp::Parser::ClangParser::__Instance::set(System::IntPtr object) |
||||
{ |
||||
NativePtr = (::CppSharp::CppParser::ClangParser*)object.ToPointer(); |
||||
} |
||||
#include "CppParser.h" |
||||
#include "AST.h" |
||||
#include "Target.h" |
||||
|
||||
using namespace System; |
||||
using namespace System::Runtime::InteropServices; |
||||
|
||||
CppSharp::Parser::ParserOptions::ParserOptions(::CppSharp::CppParser::ParserOptions* native) |
||||
{ |
||||
NativePtr = native; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserOptions::ParserOptions(System::IntPtr native) |
||||
{ |
||||
auto __native = (::CppSharp::CppParser::ParserOptions*)native.ToPointer(); |
||||
NativePtr = __native; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserOptions::ParserOptions() |
||||
{ |
||||
NativePtr = new ::CppSharp::CppParser::ParserOptions(); |
||||
} |
||||
|
||||
System::String^ CppSharp::Parser::ParserOptions::getArguments(unsigned int i) |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getArguments(i); |
||||
if (__ret == nullptr) return nullptr; |
||||
return clix::marshalString<clix::E_UTF8>(__ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::addArguments(System::String^ s) |
||||
{ |
||||
auto _arg0 = clix::marshalString<clix::E_UTF8>(s); |
||||
auto arg0 = _arg0.c_str(); |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->addArguments(arg0); |
||||
} |
||||
|
||||
System::String^ CppSharp::Parser::ParserOptions::getIncludeDirs(unsigned int i) |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getIncludeDirs(i); |
||||
if (__ret == nullptr) return nullptr; |
||||
return clix::marshalString<clix::E_UTF8>(__ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::addIncludeDirs(System::String^ s) |
||||
{ |
||||
auto _arg0 = clix::marshalString<clix::E_UTF8>(s); |
||||
auto arg0 = _arg0.c_str(); |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->addIncludeDirs(arg0); |
||||
} |
||||
|
||||
System::String^ CppSharp::Parser::ParserOptions::getSystemIncludeDirs(unsigned int i) |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getSystemIncludeDirs(i); |
||||
if (__ret == nullptr) return nullptr; |
||||
return clix::marshalString<clix::E_UTF8>(__ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::addSystemIncludeDirs(System::String^ s) |
||||
{ |
||||
auto _arg0 = clix::marshalString<clix::E_UTF8>(s); |
||||
auto arg0 = _arg0.c_str(); |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->addSystemIncludeDirs(arg0); |
||||
} |
||||
|
||||
System::String^ CppSharp::Parser::ParserOptions::getDefines(unsigned int i) |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getDefines(i); |
||||
if (__ret == nullptr) return nullptr; |
||||
return clix::marshalString<clix::E_UTF8>(__ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::addDefines(System::String^ s) |
||||
{ |
||||
auto _arg0 = clix::marshalString<clix::E_UTF8>(s); |
||||
auto arg0 = _arg0.c_str(); |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->addDefines(arg0); |
||||
} |
||||
|
||||
System::String^ CppSharp::Parser::ParserOptions::getLibraryDirs(unsigned int i) |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getLibraryDirs(i); |
||||
if (__ret == nullptr) return nullptr; |
||||
return clix::marshalString<clix::E_UTF8>(__ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::addLibraryDirs(System::String^ s) |
||||
{ |
||||
auto _arg0 = clix::marshalString<clix::E_UTF8>(s); |
||||
auto arg0 = _arg0.c_str(); |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->addLibraryDirs(arg0); |
||||
} |
||||
|
||||
System::IntPtr CppSharp::Parser::ParserOptions::__Instance::get() |
||||
{ |
||||
return System::IntPtr(NativePtr); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::__Instance::set(System::IntPtr object) |
||||
{ |
||||
NativePtr = (::CppSharp::CppParser::ParserOptions*)object.ToPointer(); |
||||
} |
||||
|
||||
unsigned int CppSharp::Parser::ParserOptions::ArgumentsCount::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getArgumentsCount(); |
||||
return __ret; |
||||
} |
||||
|
||||
System::String^ CppSharp::Parser::ParserOptions::FileName::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getFileName(); |
||||
if (__ret == nullptr) return nullptr; |
||||
return clix::marshalString<clix::E_UTF8>(__ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::FileName::set(System::String^ s) |
||||
{ |
||||
auto _arg0 = clix::marshalString<clix::E_UTF8>(s); |
||||
auto arg0 = _arg0.c_str(); |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->setFileName(arg0); |
||||
} |
||||
|
||||
unsigned int CppSharp::Parser::ParserOptions::IncludeDirsCount::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getIncludeDirsCount(); |
||||
return __ret; |
||||
} |
||||
|
||||
unsigned int CppSharp::Parser::ParserOptions::SystemIncludeDirsCount::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getSystemIncludeDirsCount(); |
||||
return __ret; |
||||
} |
||||
|
||||
unsigned int CppSharp::Parser::ParserOptions::DefinesCount::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getDefinesCount(); |
||||
return __ret; |
||||
} |
||||
|
||||
unsigned int CppSharp::Parser::ParserOptions::LibraryDirsCount::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getLibraryDirsCount(); |
||||
return __ret; |
||||
} |
||||
|
||||
System::String^ CppSharp::Parser::ParserOptions::TargetTriple::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserOptions*)NativePtr)->getTargetTriple(); |
||||
if (__ret == nullptr) return nullptr; |
||||
return clix::marshalString<clix::E_UTF8>(__ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::TargetTriple::set(System::String^ s) |
||||
{ |
||||
auto _arg0 = clix::marshalString<clix::E_UTF8>(s); |
||||
auto arg0 = _arg0.c_str(); |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->setTargetTriple(arg0); |
||||
} |
||||
|
||||
CppSharp::Parser::AST::ASTContext^ CppSharp::Parser::ParserOptions::ASTContext::get() |
||||
{ |
||||
return (((::CppSharp::CppParser::ParserOptions*)NativePtr)->ASTContext == nullptr) ? nullptr : gcnew CppSharp::Parser::AST::ASTContext((::CppSharp::CppParser::AST::ASTContext*)((::CppSharp::CppParser::ParserOptions*)NativePtr)->ASTContext); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::ASTContext::set(CppSharp::Parser::AST::ASTContext^ value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->ASTContext = (::CppSharp::CppParser::AST::ASTContext*)value->NativePtr; |
||||
} |
||||
|
||||
int CppSharp::Parser::ParserOptions::ToolSetToUse::get() |
||||
{ |
||||
return ((::CppSharp::CppParser::ParserOptions*)NativePtr)->ToolSetToUse; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::ToolSetToUse::set(int value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->ToolSetToUse = value; |
||||
} |
||||
|
||||
CppSharp::Parser::AST::CppAbi CppSharp::Parser::ParserOptions::Abi::get() |
||||
{ |
||||
return (CppSharp::Parser::AST::CppAbi)((::CppSharp::CppParser::ParserOptions*)NativePtr)->Abi; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::Abi::set(CppSharp::Parser::AST::CppAbi value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->Abi = (::CppSharp::CppParser::AST::CppAbi)value; |
||||
} |
||||
|
||||
bool CppSharp::Parser::ParserOptions::NoStandardIncludes::get() |
||||
{ |
||||
return ((::CppSharp::CppParser::ParserOptions*)NativePtr)->NoStandardIncludes; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::NoStandardIncludes::set(bool value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->NoStandardIncludes = value; |
||||
} |
||||
|
||||
bool CppSharp::Parser::ParserOptions::NoBuiltinIncludes::get() |
||||
{ |
||||
return ((::CppSharp::CppParser::ParserOptions*)NativePtr)->NoBuiltinIncludes; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::NoBuiltinIncludes::set(bool value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->NoBuiltinIncludes = value; |
||||
} |
||||
|
||||
bool CppSharp::Parser::ParserOptions::MicrosoftMode::get() |
||||
{ |
||||
return ((::CppSharp::CppParser::ParserOptions*)NativePtr)->MicrosoftMode; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::MicrosoftMode::set(bool value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->MicrosoftMode = value; |
||||
} |
||||
|
||||
bool CppSharp::Parser::ParserOptions::Verbose::get() |
||||
{ |
||||
return ((::CppSharp::CppParser::ParserOptions*)NativePtr)->Verbose; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserOptions::Verbose::set(bool value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserOptions*)NativePtr)->Verbose = value; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserDiagnostic::ParserDiagnostic(::CppSharp::CppParser::ParserDiagnostic* native) |
||||
{ |
||||
NativePtr = native; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserDiagnostic::ParserDiagnostic(System::IntPtr native) |
||||
{ |
||||
auto __native = (::CppSharp::CppParser::ParserDiagnostic*)native.ToPointer(); |
||||
NativePtr = __native; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserDiagnostic::ParserDiagnostic() |
||||
{ |
||||
NativePtr = new ::CppSharp::CppParser::ParserDiagnostic(); |
||||
} |
||||
|
||||
System::IntPtr CppSharp::Parser::ParserDiagnostic::__Instance::get() |
||||
{ |
||||
return System::IntPtr(NativePtr); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserDiagnostic::__Instance::set(System::IntPtr object) |
||||
{ |
||||
NativePtr = (::CppSharp::CppParser::ParserDiagnostic*)object.ToPointer(); |
||||
} |
||||
|
||||
System::String^ CppSharp::Parser::ParserDiagnostic::FileName::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->getFileName(); |
||||
if (__ret == nullptr) return nullptr; |
||||
return clix::marshalString<clix::E_UTF8>(__ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserDiagnostic::FileName::set(System::String^ s) |
||||
{ |
||||
auto _arg0 = clix::marshalString<clix::E_UTF8>(s); |
||||
auto arg0 = _arg0.c_str(); |
||||
((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->setFileName(arg0); |
||||
} |
||||
|
||||
System::String^ CppSharp::Parser::ParserDiagnostic::Message::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->getMessage(); |
||||
if (__ret == nullptr) return nullptr; |
||||
return clix::marshalString<clix::E_UTF8>(__ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserDiagnostic::Message::set(System::String^ s) |
||||
{ |
||||
auto _arg0 = clix::marshalString<clix::E_UTF8>(s); |
||||
auto arg0 = _arg0.c_str(); |
||||
((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->setMessage(arg0); |
||||
} |
||||
|
||||
CppSharp::Parser::ParserDiagnosticLevel CppSharp::Parser::ParserDiagnostic::Level::get() |
||||
{ |
||||
return (CppSharp::Parser::ParserDiagnosticLevel)((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->Level; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserDiagnostic::Level::set(CppSharp::Parser::ParserDiagnosticLevel value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->Level = (::CppSharp::CppParser::ParserDiagnosticLevel)value; |
||||
} |
||||
|
||||
int CppSharp::Parser::ParserDiagnostic::LineNumber::get() |
||||
{ |
||||
return ((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->LineNumber; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserDiagnostic::LineNumber::set(int value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->LineNumber = value; |
||||
} |
||||
|
||||
int CppSharp::Parser::ParserDiagnostic::ColumnNumber::get() |
||||
{ |
||||
return ((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->ColumnNumber; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserDiagnostic::ColumnNumber::set(int value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserDiagnostic*)NativePtr)->ColumnNumber = value; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserResult::ParserResult(::CppSharp::CppParser::ParserResult* native) |
||||
{ |
||||
NativePtr = native; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserResult::ParserResult(System::IntPtr native) |
||||
{ |
||||
auto __native = (::CppSharp::CppParser::ParserResult*)native.ToPointer(); |
||||
NativePtr = __native; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserResult::ParserResult() |
||||
{ |
||||
NativePtr = new ::CppSharp::CppParser::ParserResult(); |
||||
} |
||||
|
||||
CppSharp::Parser::ParserDiagnostic^ CppSharp::Parser::ParserResult::getDiagnostics(unsigned int i) |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserResult*)NativePtr)->getDiagnostics(i); |
||||
auto ____ret = new ::CppSharp::CppParser::ParserDiagnostic(__ret); |
||||
return (____ret == nullptr) ? nullptr : gcnew CppSharp::Parser::ParserDiagnostic((::CppSharp::CppParser::ParserDiagnostic*)____ret); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserResult::addDiagnostics(CppSharp::Parser::ParserDiagnostic^ s) |
||||
{ |
||||
auto &arg0 = *(::CppSharp::CppParser::ParserDiagnostic*)s->NativePtr; |
||||
((::CppSharp::CppParser::ParserResult*)NativePtr)->addDiagnostics(arg0); |
||||
} |
||||
|
||||
System::IntPtr CppSharp::Parser::ParserResult::__Instance::get() |
||||
{ |
||||
return System::IntPtr(NativePtr); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserResult::__Instance::set(System::IntPtr object) |
||||
{ |
||||
NativePtr = (::CppSharp::CppParser::ParserResult*)object.ToPointer(); |
||||
} |
||||
|
||||
unsigned int CppSharp::Parser::ParserResult::DiagnosticsCount::get() |
||||
{ |
||||
auto __ret = ((::CppSharp::CppParser::ParserResult*)NativePtr)->getDiagnosticsCount(); |
||||
return __ret; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserResultKind CppSharp::Parser::ParserResult::Kind::get() |
||||
{ |
||||
return (CppSharp::Parser::ParserResultKind)((::CppSharp::CppParser::ParserResult*)NativePtr)->Kind; |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserResult::Kind::set(CppSharp::Parser::ParserResultKind value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserResult*)NativePtr)->Kind = (::CppSharp::CppParser::ParserResultKind)value; |
||||
} |
||||
|
||||
CppSharp::Parser::AST::ASTContext^ CppSharp::Parser::ParserResult::ASTContext::get() |
||||
{ |
||||
return (((::CppSharp::CppParser::ParserResult*)NativePtr)->ASTContext == nullptr) ? nullptr : gcnew CppSharp::Parser::AST::ASTContext((::CppSharp::CppParser::AST::ASTContext*)((::CppSharp::CppParser::ParserResult*)NativePtr)->ASTContext); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserResult::ASTContext::set(CppSharp::Parser::AST::ASTContext^ value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserResult*)NativePtr)->ASTContext = (::CppSharp::CppParser::AST::ASTContext*)value->NativePtr; |
||||
} |
||||
|
||||
CppSharp::Parser::AST::NativeLibrary^ CppSharp::Parser::ParserResult::Library::get() |
||||
{ |
||||
return (((::CppSharp::CppParser::ParserResult*)NativePtr)->Library == nullptr) ? nullptr : gcnew CppSharp::Parser::AST::NativeLibrary((::CppSharp::CppParser::AST::NativeLibrary*)((::CppSharp::CppParser::ParserResult*)NativePtr)->Library); |
||||
} |
||||
|
||||
void CppSharp::Parser::ParserResult::Library::set(CppSharp::Parser::AST::NativeLibrary^ value) |
||||
{ |
||||
((::CppSharp::CppParser::ParserResult*)NativePtr)->Library = (::CppSharp::CppParser::AST::NativeLibrary*)value->NativePtr; |
||||
} |
||||
|
||||
CppSharp::Parser::ClangParser::ClangParser(::CppSharp::CppParser::ClangParser* native) |
||||
{ |
||||
NativePtr = native; |
||||
} |
||||
|
||||
CppSharp::Parser::ClangParser::ClangParser(System::IntPtr native) |
||||
{ |
||||
auto __native = (::CppSharp::CppParser::ClangParser*)native.ToPointer(); |
||||
NativePtr = __native; |
||||
} |
||||
|
||||
CppSharp::Parser::ParserResult^ CppSharp::Parser::ClangParser::ParseHeader(CppSharp::Parser::ParserOptions^ Opts) |
||||
{ |
||||
auto arg0 = (::CppSharp::CppParser::ParserOptions*)Opts->NativePtr; |
||||
auto __ret = ::CppSharp::CppParser::ClangParser::ParseHeader(arg0); |
||||
if (__ret == nullptr) return nullptr; |
||||
return (__ret == nullptr) ? nullptr : gcnew CppSharp::Parser::ParserResult((::CppSharp::CppParser::ParserResult*)__ret); |
||||
} |
||||
|
||||
CppSharp::Parser::ParserResult^ CppSharp::Parser::ClangParser::ParseLibrary(CppSharp::Parser::ParserOptions^ Opts) |
||||
{ |
||||
auto arg0 = (::CppSharp::CppParser::ParserOptions*)Opts->NativePtr; |
||||
auto __ret = ::CppSharp::CppParser::ClangParser::ParseLibrary(arg0); |
||||
if (__ret == nullptr) return nullptr; |
||||
return (__ret == nullptr) ? nullptr : gcnew CppSharp::Parser::ParserResult((::CppSharp::CppParser::ParserResult*)__ret); |
||||
} |
||||
|
||||
CppSharp::Parser::ParserTargetInfo^ CppSharp::Parser::ClangParser::GetTargetInfo(CppSharp::Parser::ParserOptions^ Opts) |
||||
{ |
||||
auto arg0 = (::CppSharp::CppParser::ParserOptions*)Opts->NativePtr; |
||||
auto __ret = ::CppSharp::CppParser::ClangParser::GetTargetInfo(arg0); |
||||
if (__ret == nullptr) return nullptr; |
||||
return (__ret == nullptr) ? nullptr : gcnew CppSharp::Parser::ParserTargetInfo((::CppSharp::CppParser::ParserTargetInfo*)__ret); |
||||
} |
||||
|
||||
CppSharp::Parser::ClangParser::ClangParser() |
||||
{ |
||||
NativePtr = new ::CppSharp::CppParser::ClangParser(); |
||||
} |
||||
|
||||
System::IntPtr CppSharp::Parser::ClangParser::__Instance::get() |
||||
{ |
||||
return System::IntPtr(NativePtr); |
||||
} |
||||
|
||||
void CppSharp::Parser::ClangParser::__Instance::set(System::IntPtr object) |
||||
{ |
||||
NativePtr = (::CppSharp::CppParser::ClangParser*)object.ToPointer(); |
||||
} |
||||
|
@ -1,283 +1,283 @@
@@ -1,283 +1,283 @@
|
||||
#pragma once |
||||
|
||||
#include "CppSharp.h" |
||||
#include <CppParser.h> |
||||
|
||||
namespace CppSharp |
||||
{ |
||||
namespace Parser |
||||
{ |
||||
enum struct ParserDiagnosticLevel; |
||||
enum struct ParserResultKind; |
||||
enum struct SourceLocationKind; |
||||
ref class ClangParser; |
||||
ref class Parser; |
||||
ref class ParserDiagnostic; |
||||
ref class ParserOptions; |
||||
ref class ParserResult; |
||||
ref class ParserTargetInfo; |
||||
namespace AST |
||||
{ |
||||
enum struct CppAbi; |
||||
ref class ASTContext; |
||||
ref class NativeLibrary; |
||||
} |
||||
} |
||||
} |
||||
|
||||
namespace CppSharp |
||||
{ |
||||
namespace Parser |
||||
{ |
||||
public enum struct ParserDiagnosticLevel |
||||
{ |
||||
Ignored = 0, |
||||
Note = 1, |
||||
Warning = 2, |
||||
Error = 3, |
||||
Fatal = 4 |
||||
}; |
||||
|
||||
public enum struct ParserResultKind |
||||
{ |
||||
Success = 0, |
||||
Error = 1, |
||||
FileNotFound = 2 |
||||
}; |
||||
|
||||
public enum struct SourceLocationKind |
||||
{ |
||||
Invalid = 0, |
||||
Builtin = 1, |
||||
CommandLine = 2, |
||||
System = 3, |
||||
User = 4 |
||||
}; |
||||
|
||||
public ref class ParserOptions : ICppInstance |
||||
{ |
||||
public: |
||||
|
||||
property ::CppSharp::CppParser::ParserOptions* NativePtr; |
||||
property System::IntPtr __Instance |
||||
{ |
||||
virtual System::IntPtr get(); |
||||
virtual void set(System::IntPtr instance); |
||||
} |
||||
|
||||
ParserOptions(::CppSharp::CppParser::ParserOptions* native); |
||||
ParserOptions(System::IntPtr native); |
||||
ParserOptions(); |
||||
|
||||
property unsigned int ArgumentsCount |
||||
{ |
||||
unsigned int get(); |
||||
} |
||||
|
||||
property System::String^ FileName |
||||
{ |
||||
System::String^ get(); |
||||
void set(System::String^); |
||||
} |
||||
|
||||
property unsigned int IncludeDirsCount |
||||
{ |
||||
unsigned int get(); |
||||
} |
||||
|
||||
property unsigned int SystemIncludeDirsCount |
||||
{ |
||||
unsigned int get(); |
||||
} |
||||
|
||||
property unsigned int DefinesCount |
||||
{ |
||||
unsigned int get(); |
||||
} |
||||
|
||||
property unsigned int LibraryDirsCount |
||||
{ |
||||
unsigned int get(); |
||||
} |
||||
|
||||
property System::String^ TargetTriple |
||||
{ |
||||
System::String^ get(); |
||||
void set(System::String^); |
||||
} |
||||
|
||||
property CppSharp::Parser::AST::ASTContext^ ASTContext |
||||
{ |
||||
CppSharp::Parser::AST::ASTContext^ get(); |
||||
void set(CppSharp::Parser::AST::ASTContext^); |
||||
} |
||||
|
||||
property int ToolSetToUse |
||||
{ |
||||
int get(); |
||||
void set(int); |
||||
} |
||||
|
||||
property CppSharp::Parser::AST::CppAbi Abi |
||||
{ |
||||
CppSharp::Parser::AST::CppAbi get(); |
||||
void set(CppSharp::Parser::AST::CppAbi); |
||||
} |
||||
|
||||
property bool NoStandardIncludes |
||||
{ |
||||
bool get(); |
||||
void set(bool); |
||||
} |
||||
|
||||
property bool NoBuiltinIncludes |
||||
{ |
||||
bool get(); |
||||
void set(bool); |
||||
} |
||||
|
||||
property bool MicrosoftMode |
||||
{ |
||||
bool get(); |
||||
void set(bool); |
||||
} |
||||
|
||||
property bool Verbose |
||||
{ |
||||
bool get(); |
||||
void set(bool); |
||||
} |
||||
|
||||
System::String^ getArguments(unsigned int i); |
||||
|
||||
void addArguments(System::String^ s); |
||||
|
||||
System::String^ getIncludeDirs(unsigned int i); |
||||
|
||||
void addIncludeDirs(System::String^ s); |
||||
|
||||
System::String^ getSystemIncludeDirs(unsigned int i); |
||||
|
||||
void addSystemIncludeDirs(System::String^ s); |
||||
|
||||
System::String^ getDefines(unsigned int i); |
||||
|
||||
void addDefines(System::String^ s); |
||||
|
||||
System::String^ getLibraryDirs(unsigned int i); |
||||
|
||||
void addLibraryDirs(System::String^ s); |
||||
}; |
||||
|
||||
public ref class ParserDiagnostic : ICppInstance |
||||
{ |
||||
public: |
||||
|
||||
property ::CppSharp::CppParser::ParserDiagnostic* NativePtr; |
||||
property System::IntPtr __Instance |
||||
{ |
||||
virtual System::IntPtr get(); |
||||
virtual void set(System::IntPtr instance); |
||||
} |
||||
|
||||
ParserDiagnostic(::CppSharp::CppParser::ParserDiagnostic* native); |
||||
ParserDiagnostic(System::IntPtr native); |
||||
ParserDiagnostic(); |
||||
|
||||
property System::String^ FileName |
||||
{ |
||||
System::String^ get(); |
||||
void set(System::String^); |
||||
} |
||||
|
||||
property System::String^ Message |
||||
{ |
||||
System::String^ get(); |
||||
void set(System::String^); |
||||
} |
||||
|
||||
property CppSharp::Parser::ParserDiagnosticLevel Level |
||||
{ |
||||
CppSharp::Parser::ParserDiagnosticLevel get(); |
||||
void set(CppSharp::Parser::ParserDiagnosticLevel); |
||||
} |
||||
|
||||
property int LineNumber |
||||
{ |
||||
int get(); |
||||
void set(int); |
||||
} |
||||
|
||||
property int ColumnNumber |
||||
{ |
||||
int get(); |
||||
void set(int); |
||||
} |
||||
}; |
||||
|
||||
public ref class ParserResult : ICppInstance |
||||
{ |
||||
public: |
||||
|
||||
property ::CppSharp::CppParser::ParserResult* NativePtr; |
||||
property System::IntPtr __Instance |
||||
{ |
||||
virtual System::IntPtr get(); |
||||
virtual void set(System::IntPtr instance); |
||||
} |
||||
|
||||
ParserResult(::CppSharp::CppParser::ParserResult* native); |
||||
ParserResult(System::IntPtr native); |
||||
ParserResult(); |
||||
|
||||
property unsigned int DiagnosticsCount |
||||
{ |
||||
unsigned int get(); |
||||
} |
||||
|
||||
property CppSharp::Parser::ParserResultKind Kind |
||||
{ |
||||
CppSharp::Parser::ParserResultKind get(); |
||||
void set(CppSharp::Parser::ParserResultKind); |
||||
} |
||||
|
||||
property CppSharp::Parser::AST::ASTContext^ ASTContext |
||||
{ |
||||
CppSharp::Parser::AST::ASTContext^ get(); |
||||
void set(CppSharp::Parser::AST::ASTContext^); |
||||
} |
||||
|
||||
property CppSharp::Parser::AST::NativeLibrary^ Library |
||||
{ |
||||
CppSharp::Parser::AST::NativeLibrary^ get(); |
||||
void set(CppSharp::Parser::AST::NativeLibrary^); |
||||
} |
||||
|
||||
CppSharp::Parser::ParserDiagnostic^ getDiagnostics(unsigned int i); |
||||
|
||||
void addDiagnostics(CppSharp::Parser::ParserDiagnostic^ s); |
||||
}; |
||||
|
||||
public ref class ClangParser : ICppInstance |
||||
{ |
||||
public: |
||||
|
||||
property ::CppSharp::CppParser::ClangParser* NativePtr; |
||||
property System::IntPtr __Instance |
||||
{ |
||||
virtual System::IntPtr get(); |
||||
virtual void set(System::IntPtr instance); |
||||
} |
||||
|
||||
ClangParser(::CppSharp::CppParser::ClangParser* native); |
||||
ClangParser(System::IntPtr native); |
||||
ClangParser(); |
||||
|
||||
static CppSharp::Parser::ParserResult^ ParseHeader(CppSharp::Parser::ParserOptions^ Opts); |
||||
|
||||
static CppSharp::Parser::ParserResult^ ParseLibrary(CppSharp::Parser::ParserOptions^ Opts); |
||||
|
||||
static CppSharp::Parser::ParserTargetInfo^ GetTargetInfo(CppSharp::Parser::ParserOptions^ Opts); |
||||
}; |
||||
} |
||||
} |
||||
#pragma once |
||||
|
||||
#include "CppSharp.h" |
||||
#include <CppParser.h> |
||||
|
||||
namespace CppSharp |
||||
{ |
||||
namespace Parser |
||||
{ |
||||
enum struct ParserDiagnosticLevel; |
||||
enum struct ParserResultKind; |
||||
enum struct SourceLocationKind; |
||||
ref class ClangParser; |
||||
ref class Parser; |
||||
ref class ParserDiagnostic; |
||||
ref class ParserOptions; |
||||
ref class ParserResult; |
||||
ref class ParserTargetInfo; |
||||
namespace AST |
||||
{ |
||||
enum struct CppAbi; |
||||
ref class ASTContext; |
||||
ref class NativeLibrary; |
||||
} |
||||
} |
||||
} |
||||
|
||||
namespace CppSharp |
||||
{ |
||||
namespace Parser |
||||
{ |
||||
public enum struct ParserDiagnosticLevel |
||||
{ |
||||
Ignored = 0, |
||||
Note = 1, |
||||
Warning = 2, |
||||
Error = 3, |
||||
Fatal = 4 |
||||
}; |
||||
|
||||
public enum struct ParserResultKind |
||||
{ |
||||
Success = 0, |
||||
Error = 1, |
||||
FileNotFound = 2 |
||||
}; |
||||
|
||||
public enum struct SourceLocationKind |
||||
{ |
||||
Invalid = 0, |
||||
Builtin = 1, |
||||
CommandLine = 2, |
||||
System = 3, |
||||
User = 4 |
||||
}; |
||||
|
||||
public ref class ParserOptions : ICppInstance |
||||
{ |
||||
public: |
||||
|
||||
property ::CppSharp::CppParser::ParserOptions* NativePtr; |
||||
property System::IntPtr __Instance |
||||
{ |
||||
virtual System::IntPtr get(); |
||||
virtual void set(System::IntPtr instance); |
||||
} |
||||
|
||||
ParserOptions(::CppSharp::CppParser::ParserOptions* native); |
||||
ParserOptions(System::IntPtr native); |
||||
ParserOptions(); |
||||
|
||||
property unsigned int ArgumentsCount |
||||
{ |
||||
unsigned int get(); |
||||
} |
||||
|
||||
property System::String^ FileName |
||||
{ |
||||
System::String^ get(); |
||||
void set(System::String^); |
||||
} |
||||
|
||||
property unsigned int IncludeDirsCount |
||||
{ |
||||
unsigned int get(); |
||||
} |
||||
|
||||
property unsigned int SystemIncludeDirsCount |
||||
{ |
||||
unsigned int get(); |
||||
} |
||||
|
||||
property unsigned int DefinesCount |
||||
{ |
||||
unsigned int get(); |
||||
} |
||||
|
||||
property unsigned int LibraryDirsCount |
||||
{ |
||||
unsigned int get(); |
||||
} |
||||
|
||||
property System::String^ TargetTriple |
||||
{ |
||||
System::String^ get(); |
||||
void set(System::String^); |
||||
} |
||||
|
||||
property CppSharp::Parser::AST::ASTContext^ ASTContext |
||||
{ |
||||
CppSharp::Parser::AST::ASTContext^ get(); |
||||
void set(CppSharp::Parser::AST::ASTContext^); |
||||
} |
||||
|
||||
property int ToolSetToUse |
||||
{ |
||||
int get(); |
||||
void set(int); |
||||
} |
||||
|
||||
property CppSharp::Parser::AST::CppAbi Abi |
||||
{ |
||||
CppSharp::Parser::AST::CppAbi get(); |
||||
void set(CppSharp::Parser::AST::CppAbi); |
||||
} |
||||
|
||||
property bool NoStandardIncludes |
||||
{ |
||||
bool get(); |
||||
void set(bool); |
||||
} |
||||
|
||||
property bool NoBuiltinIncludes |
||||
{ |
||||
bool get(); |
||||
void set(bool); |
||||
} |
||||
|
||||
property bool MicrosoftMode |
||||
{ |
||||
bool get(); |
||||
void set(bool); |
||||
} |
||||
|
||||
property bool Verbose |
||||
{ |
||||
bool get(); |
||||
void set(bool); |
||||
} |
||||
|
||||
System::String^ getArguments(unsigned int i); |
||||
|
||||
void addArguments(System::String^ s); |
||||
|
||||
System::String^ getIncludeDirs(unsigned int i); |
||||
|
||||
void addIncludeDirs(System::String^ s); |
||||
|
||||
System::String^ getSystemIncludeDirs(unsigned int i); |
||||
|
||||
void addSystemIncludeDirs(System::String^ s); |
||||
|
||||
System::String^ getDefines(unsigned int i); |
||||
|
||||
void addDefines(System::String^ s); |
||||
|
||||
System::String^ getLibraryDirs(unsigned int i); |
||||
|
||||
void addLibraryDirs(System::String^ s); |
||||
}; |
||||
|
||||
public ref class ParserDiagnostic : ICppInstance |
||||
{ |
||||
public: |
||||
|
||||
property ::CppSharp::CppParser::ParserDiagnostic* NativePtr; |
||||
property System::IntPtr __Instance |
||||
{ |
||||
virtual System::IntPtr get(); |
||||
virtual void set(System::IntPtr instance); |
||||
} |
||||
|
||||
ParserDiagnostic(::CppSharp::CppParser::ParserDiagnostic* native); |
||||
ParserDiagnostic(System::IntPtr native); |
||||
ParserDiagnostic(); |
||||
|
||||
property System::String^ FileName |
||||
{ |
||||
System::String^ get(); |
||||
void set(System::String^); |
||||
} |
||||
|
||||
property System::String^ Message |
||||
{ |
||||
System::String^ get(); |
||||
void set(System::String^); |
||||
} |
||||
|
||||
property CppSharp::Parser::ParserDiagnosticLevel Level |
||||
{ |
||||
CppSharp::Parser::ParserDiagnosticLevel get(); |
||||
void set(CppSharp::Parser::ParserDiagnosticLevel); |
||||
} |
||||
|
||||
property int LineNumber |
||||
{ |
||||
int get(); |
||||
void set(int); |
||||
} |
||||
|
||||
property int ColumnNumber |
||||
{ |
||||
int get(); |
||||
void set(int); |
||||
} |
||||
}; |
||||
|
||||
public ref class ParserResult : ICppInstance |
||||
{ |
||||
public: |
||||
|
||||
property ::CppSharp::CppParser::ParserResult* NativePtr; |
||||
property System::IntPtr __Instance |
||||
{ |
||||
virtual System::IntPtr get(); |
||||
virtual void set(System::IntPtr instance); |
||||
} |
||||
|
||||
ParserResult(::CppSharp::CppParser::ParserResult* native); |
||||
ParserResult(System::IntPtr native); |
||||
ParserResult(); |
||||
|
||||
property unsigned int DiagnosticsCount |
||||
{ |
||||
unsigned int get(); |
||||
} |
||||
|
||||
property CppSharp::Parser::ParserResultKind Kind |
||||
{ |
||||
CppSharp::Parser::ParserResultKind get(); |
||||
void set(CppSharp::Parser::ParserResultKind); |
||||
} |
||||
|
||||
property CppSharp::Parser::AST::ASTContext^ ASTContext |
||||
{ |
||||
CppSharp::Parser::AST::ASTContext^ get(); |
||||
void set(CppSharp::Parser::AST::ASTContext^); |
||||
} |
||||
|
||||
property CppSharp::Parser::AST::NativeLibrary^ Library |
||||
{ |
||||
CppSharp::Parser::AST::NativeLibrary^ get(); |
||||
void set(CppSharp::Parser::AST::NativeLibrary^); |
||||
} |
||||
|
||||
CppSharp::Parser::ParserDiagnostic^ getDiagnostics(unsigned int i); |
||||
|
||||
void addDiagnostics(CppSharp::Parser::ParserDiagnostic^ s); |
||||
}; |
||||
|
||||
public ref class ClangParser : ICppInstance |
||||
{ |
||||
public: |
||||
|
||||
property ::CppSharp::CppParser::ClangParser* NativePtr; |
||||
property System::IntPtr __Instance |
||||
{ |
||||
virtual System::IntPtr get(); |
||||
virtual void set(System::IntPtr instance); |
||||
} |
||||
|
||||
ClangParser(::CppSharp::CppParser::ClangParser* native); |
||||
ClangParser(System::IntPtr native); |
||||
ClangParser(); |
||||
|
||||
static CppSharp::Parser::ParserResult^ ParseHeader(CppSharp::Parser::ParserOptions^ Opts); |
||||
|
||||
static CppSharp::Parser::ParserResult^ ParseLibrary(CppSharp::Parser::ParserOptions^ Opts); |
||||
|
||||
static CppSharp::Parser::ParserTargetInfo^ GetTargetInfo(CppSharp::Parser::ParserOptions^ Opts); |
||||
}; |
||||
} |
||||
} |
||||
|
@ -1,17 +1,17 @@
@@ -1,17 +1,17 @@
|
||||
project "CppSharp.Generator" |
||||
|
||||
kind "SharedLib" |
||||
language "C#" |
||||
location "." |
||||
|
||||
SetupManagedProject() |
||||
|
||||
files { "**.cs", "**verbs.txt" } |
||||
excludes { "Filter.cs" } |
||||
|
||||
links { "System", "System.Core", "CppSharp", "CppSharp.AST" } |
||||
|
||||
SetupParser() |
||||
|
||||
configuration '**verbs.txt' |
||||
buildaction "Embed" |
||||
project "CppSharp.Generator" |
||||
|
||||
kind "SharedLib" |
||||
language "C#" |
||||
location "." |
||||
|
||||
SetupManagedProject() |
||||
|
||||
files { "**.cs", "**verbs.txt" } |
||||
excludes { "Filter.cs" } |
||||
|
||||
links { "System", "System.Core", "CppSharp", "CppSharp.AST" } |
||||
|
||||
SetupParser() |
||||
|
||||
configuration '**verbs.txt' |
||||
buildaction "Embed" |
||||
|
@ -1,398 +1,398 @@
@@ -1,398 +1,398 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using CppSharp.AST; |
||||
using CppSharp.AST.Extensions; |
||||
using CppSharp.Types; |
||||
using Type = CppSharp.AST.Type; |
||||
|
||||
namespace CppSharp.Generators.CLI |
||||
{ |
||||
public class CLITypePrinterContext : TypePrinterContext |
||||
{ |
||||
public CLITypePrinterContext() |
||||
{ |
||||
|
||||
} |
||||
|
||||
public CLITypePrinterContext(TypePrinterContextKind kind) |
||||
: base(kind) |
||||
{ |
||||
} |
||||
} |
||||
|
||||
public class CLITypePrinter : ITypePrinter<string>, IDeclVisitor<string> |
||||
{ |
||||
public Driver Driver { get; set; } |
||||
public CLITypePrinterContext Context { get; set; } |
||||
|
||||
readonly ITypeMapDatabase TypeMapDatabase; |
||||
readonly DriverOptions Options; |
||||
|
||||
public CLITypePrinter(Driver driver) |
||||
{ |
||||
Driver = driver; |
||||
TypeMapDatabase = driver.TypeDatabase; |
||||
Options = driver.Options; |
||||
Context = new CLITypePrinterContext(); |
||||
} |
||||
|
||||
public CLITypePrinter(Driver driver, CLITypePrinterContext context) |
||||
: this(driver) |
||||
{ |
||||
Context = context; |
||||
} |
||||
|
||||
public string VisitTagType(TagType tag, TypeQualifiers quals) |
||||
{ |
||||
TypeMap typeMap = null; |
||||
if (TypeMapDatabase.FindTypeMap(tag, out typeMap)) |
||||
{ |
||||
typeMap.Type = tag; |
||||
Context.Type = tag; |
||||
return typeMap.CLISignature(Context); |
||||
} |
||||
|
||||
Declaration decl = tag.Declaration; |
||||
|
||||
if (decl == null) |
||||
return string.Empty; |
||||
|
||||
return VisitDeclaration(decl, quals); |
||||
} |
||||
|
||||
public string VisitArrayType(ArrayType array, TypeQualifiers quals) |
||||
{ |
||||
return string.Format("cli::array<{0}>^", array.Type.Visit(this)); |
||||
} |
||||
|
||||
public string VisitFunctionType(FunctionType function, TypeQualifiers quals) |
||||
{ |
||||
var arguments = function.Parameters; |
||||
var returnType = function.ReturnType; |
||||
var args = string.Empty; |
||||
|
||||
if (arguments.Count > 0) |
||||
args = VisitParameters(function.Parameters, hasNames: false); |
||||
|
||||
if (returnType.Type.IsPrimitiveType(PrimitiveType.Void)) |
||||
{ |
||||
if (!string.IsNullOrEmpty(args)) |
||||
args = string.Format("<{0}>", args); |
||||
return string.Format("System::Action{0}", args); |
||||
} |
||||
|
||||
if (!string.IsNullOrEmpty(args)) |
||||
args = string.Format(", {0}", args); |
||||
|
||||
return string.Format("System::Func<{0}{1}>", returnType.Visit(this), args); |
||||
} |
||||
|
||||
public string VisitParameters(IEnumerable<Parameter> @params, |
||||
bool hasNames) |
||||
{ |
||||
var args = new List<string>(); |
||||
|
||||
foreach (var param in @params) |
||||
args.Add(VisitParameter(param, hasNames)); |
||||
|
||||
return string.Join(", ", args); |
||||
} |
||||
|
||||
public string VisitParameter(Parameter param, bool hasName = true) |
||||
{ |
||||
Context.Parameter = param; |
||||
var type = param.Type.Visit(this, param.QualifiedType.Qualifiers); |
||||
Context.Parameter = null; |
||||
|
||||
var str = string.Empty; |
||||
if(param.Usage == ParameterUsage.Out) |
||||
str += "[System::Runtime::InteropServices::Out] "; |
||||
|
||||
str += type; |
||||
|
||||
if(param.Usage == ParameterUsage.Out || |
||||
param.Usage == ParameterUsage.InOut) |
||||
str += "%"; |
||||
|
||||
if (hasName && !string.IsNullOrEmpty(param.Name)) |
||||
str += " " + param.Name; |
||||
|
||||
return str; |
||||
} |
||||
|
||||
public string VisitDelegate(FunctionType function) |
||||
{ |
||||
return string.Format("delegate {0} {{0}}({1})", |
||||
function.ReturnType.Visit(this), |
||||
VisitParameters(function.Parameters, hasNames: true)); |
||||
} |
||||
|
||||
public string VisitPointerType(PointerType pointer, TypeQualifiers quals) |
||||
{ |
||||
var pointee = pointer.Pointee.Desugar(); |
||||
|
||||
if (pointee is FunctionType) |
||||
{ |
||||
var function = pointee as FunctionType; |
||||
return string.Format("{0}^", function.Visit(this, quals)); |
||||
} |
||||
|
||||
if (pointee.IsPrimitiveType(PrimitiveType.Char) && quals.IsConst) |
||||
{ |
||||
return "System::String^"; |
||||
} |
||||
|
||||
// From http://msdn.microsoft.com/en-us/library/y31yhkeb.aspx
|
||||
// Any of the following types may be a pointer type:
|
||||
// * sbyte, byte, short, ushort, int, uint, long, ulong, char, float, double, decimal, or bool.
|
||||
// * Any enum type.
|
||||
// * Any pointer type.
|
||||
// * Any user-defined struct type that contains fields of unmanaged types only.
|
||||
var finalPointee = pointer.GetFinalPointee(); |
||||
if (finalPointee.IsPrimitiveType()) |
||||
{ |
||||
// Skip one indirection if passed by reference
|
||||
var param = Context.Parameter; |
||||
if (param != null && (param.IsOut || param.IsInOut) |
||||
&& pointee == finalPointee) |
||||
return pointee.Visit(this, quals); |
||||
|
||||
return pointee.Visit(this, quals) + "*"; |
||||
} |
||||
|
||||
Enumeration @enum; |
||||
if (pointee.TryGetEnum(out @enum)) |
||||
{ |
||||
var typeName = @enum.Visit(this); |
||||
return string.Format("{0}*", typeName); |
||||
} |
||||
|
||||
return pointer.Pointee.Visit(this, quals); |
||||
} |
||||
|
||||
public string VisitMemberPointerType(MemberPointerType member, |
||||
TypeQualifiers quals) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitBuiltinType(BuiltinType builtin, TypeQualifiers quals) |
||||
{ |
||||
return VisitPrimitiveType(builtin.Type); |
||||
} |
||||
|
||||
public string VisitPrimitiveType(PrimitiveType primitive) |
||||
{ |
||||
switch (primitive) |
||||
{ |
||||
case PrimitiveType.Bool: return "bool"; |
||||
case PrimitiveType.Void: return "void"; |
||||
case PrimitiveType.Char16: |
||||
case PrimitiveType.WideChar: return "System::Char"; |
||||
case PrimitiveType.Int8: return Options.MarshalCharAsManagedChar ? "System::Char" : "char"; |
||||
case PrimitiveType.UInt8: return "unsigned char"; |
||||
case PrimitiveType.Int16: return "short"; |
||||
case PrimitiveType.UInt16: return "unsigned short"; |
||||
case PrimitiveType.Int32: return "int"; |
||||
case PrimitiveType.UInt32: return "unsigned int"; |
||||
case PrimitiveType.Int64: return "long long"; |
||||
case PrimitiveType.UInt64: return "unsigned long long"; |
||||
case PrimitiveType.Float: return "float"; |
||||
case PrimitiveType.Double: return "double"; |
||||
case PrimitiveType.IntPtr: return "IntPtr"; |
||||
case PrimitiveType.UIntPtr: return "UIntPtr"; |
||||
case PrimitiveType.Null: return "void*"; |
||||
} |
||||
|
||||
throw new NotSupportedException(); |
||||
} |
||||
|
||||
public string VisitTypedefType(TypedefType typedef, TypeQualifiers quals) |
||||
{ |
||||
var decl = typedef.Declaration; |
||||
|
||||
TypeMap typeMap = null; |
||||
if (TypeMapDatabase.FindTypeMap(decl, out typeMap)) |
||||
{ |
||||
typeMap.Type = typedef; |
||||
Context.Type = typedef; |
||||
return typeMap.CLISignature(Context); |
||||
} |
||||
|
||||
FunctionType func; |
||||
if (decl.Type.IsPointerTo<FunctionType>(out func)) |
||||
{ |
||||
// TODO: Use SafeIdentifier()
|
||||
return string.Format("{0}^", VisitDeclaration(decl)); |
||||
} |
||||
|
||||
return decl.Type.Visit(this); |
||||
} |
||||
|
||||
public string VisitAttributedType(AttributedType attributed, TypeQualifiers quals) |
||||
{ |
||||
return attributed.Modified.Visit(this); |
||||
} |
||||
|
||||
public string VisitDecayedType(DecayedType decayed, TypeQualifiers quals) |
||||
{ |
||||
return decayed.Decayed.Visit(this); |
||||
} |
||||
|
||||
public string VisitTemplateSpecializationType(TemplateSpecializationType template, |
||||
TypeQualifiers quals) |
||||
{ |
||||
var decl = template.Template.TemplatedDecl; |
||||
|
||||
TypeMap typeMap = null; |
||||
if (TypeMapDatabase.FindTypeMap(template, out typeMap)) |
||||
{ |
||||
typeMap.Declaration = decl; |
||||
typeMap.Type = template; |
||||
Context.Type = template; |
||||
return typeMap.CLISignature(Context); |
||||
} |
||||
|
||||
return decl.Name; |
||||
} |
||||
|
||||
public string VisitTemplateParameterType(TemplateParameterType param, |
||||
TypeQualifiers quals) |
||||
{ |
||||
return param.Parameter.Name; |
||||
} |
||||
|
||||
public string VisitTemplateParameterSubstitutionType( |
||||
TemplateParameterSubstitutionType param, TypeQualifiers quals) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitInjectedClassNameType(InjectedClassNameType injected, TypeQualifiers quals) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitDependentNameType(DependentNameType dependent, TypeQualifiers quals) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitPackExpansionType(PackExpansionType packExpansionType, TypeQualifiers quals) |
||||
{ |
||||
return string.Empty; |
||||
} |
||||
|
||||
public string VisitCILType(CILType type, TypeQualifiers quals) |
||||
{ |
||||
var result = type.Type.FullName.Replace(".", "::"); |
||||
if (!type.Type.IsValueType) |
||||
result += "^"; |
||||
return result; |
||||
} |
||||
|
||||
public string VisitPrimitiveType(PrimitiveType type, TypeQualifiers quals) |
||||
{ |
||||
return VisitPrimitiveType(type); |
||||
} |
||||
|
||||
public string VisitDeclaration(Declaration decl, TypeQualifiers quals) |
||||
{ |
||||
return VisitDeclaration(decl); |
||||
} |
||||
|
||||
public string VisitDeclaration(Declaration decl) |
||||
{ |
||||
var names = new List<string>(); |
||||
|
||||
if (Options.GenerateLibraryNamespace) |
||||
names.Add(Driver.Options.OutputNamespace); |
||||
|
||||
if (!string.IsNullOrEmpty(decl.Namespace.QualifiedName)) |
||||
names.Add(decl.Namespace.QualifiedName); |
||||
|
||||
names.Add(decl.Visit(this)); |
||||
|
||||
return string.Join("::", names); |
||||
} |
||||
|
||||
public string VisitClassDecl(Class @class) |
||||
{ |
||||
if (@class.CompleteDeclaration != null) |
||||
return VisitClassDecl(@class.CompleteDeclaration as Class); |
||||
|
||||
return string.Format("{0}{1}", @class.Name, @class.IsRefType ? "^" |
||||
: string.Empty); |
||||
} |
||||
|
||||
public string VisitFieldDecl(Field field) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitFunctionDecl(Function function) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitMethodDecl(Method method) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitParameterDecl(Parameter parameter) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitTypedefDecl(TypedefDecl typedef) |
||||
{ |
||||
return typedef.Name; |
||||
} |
||||
|
||||
public string VisitEnumDecl(Enumeration @enum) |
||||
{ |
||||
return @enum.Name; |
||||
} |
||||
|
||||
public string VisitVariableDecl(Variable variable) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitClassTemplateDecl(ClassTemplate template) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitFunctionTemplateDecl(FunctionTemplate template) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitMacroDefinition(MacroDefinition macro) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitNamespace(Namespace @namespace) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitEvent(Event @event) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitProperty(Property property) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string ToString(Type type) |
||||
{ |
||||
return type.Visit(this); |
||||
} |
||||
} |
||||
} |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using CppSharp.AST; |
||||
using CppSharp.AST.Extensions; |
||||
using CppSharp.Types; |
||||
using Type = CppSharp.AST.Type; |
||||
|
||||
namespace CppSharp.Generators.CLI |
||||
{ |
||||
public class CLITypePrinterContext : TypePrinterContext |
||||
{ |
||||
public CLITypePrinterContext() |
||||
{ |
||||
|
||||
} |
||||
|
||||
public CLITypePrinterContext(TypePrinterContextKind kind) |
||||
: base(kind) |
||||
{ |
||||
} |
||||
} |
||||
|
||||
public class CLITypePrinter : ITypePrinter<string>, IDeclVisitor<string> |
||||
{ |
||||
public Driver Driver { get; set; } |
||||
public CLITypePrinterContext Context { get; set; } |
||||
|
||||
readonly ITypeMapDatabase TypeMapDatabase; |
||||
readonly DriverOptions Options; |
||||
|
||||
public CLITypePrinter(Driver driver) |
||||
{ |
||||
Driver = driver; |
||||
TypeMapDatabase = driver.TypeDatabase; |
||||
Options = driver.Options; |
||||
Context = new CLITypePrinterContext(); |
||||
} |
||||
|
||||
public CLITypePrinter(Driver driver, CLITypePrinterContext context) |
||||
: this(driver) |
||||
{ |
||||
Context = context; |
||||
} |
||||
|
||||
public string VisitTagType(TagType tag, TypeQualifiers quals) |
||||
{ |
||||
TypeMap typeMap = null; |
||||
if (TypeMapDatabase.FindTypeMap(tag, out typeMap)) |
||||
{ |
||||
typeMap.Type = tag; |
||||
Context.Type = tag; |
||||
return typeMap.CLISignature(Context); |
||||
} |
||||
|
||||
Declaration decl = tag.Declaration; |
||||
|
||||
if (decl == null) |
||||
return string.Empty; |
||||
|
||||
return VisitDeclaration(decl, quals); |
||||
} |
||||
|
||||
public string VisitArrayType(ArrayType array, TypeQualifiers quals) |
||||
{ |
||||
return string.Format("cli::array<{0}>^", array.Type.Visit(this)); |
||||
} |
||||
|
||||
public string VisitFunctionType(FunctionType function, TypeQualifiers quals) |
||||
{ |
||||
var arguments = function.Parameters; |
||||
var returnType = function.ReturnType; |
||||
var args = string.Empty; |
||||
|
||||
if (arguments.Count > 0) |
||||
args = VisitParameters(function.Parameters, hasNames: false); |
||||
|
||||
if (returnType.Type.IsPrimitiveType(PrimitiveType.Void)) |
||||
{ |
||||
if (!string.IsNullOrEmpty(args)) |
||||
args = string.Format("<{0}>", args); |
||||
return string.Format("System::Action{0}", args); |
||||
} |
||||
|
||||
if (!string.IsNullOrEmpty(args)) |
||||
args = string.Format(", {0}", args); |
||||
|
||||
return string.Format("System::Func<{0}{1}>", returnType.Visit(this), args); |
||||
} |
||||
|
||||
public string VisitParameters(IEnumerable<Parameter> @params, |
||||
bool hasNames) |
||||
{ |
||||
var args = new List<string>(); |
||||
|
||||
foreach (var param in @params) |
||||
args.Add(VisitParameter(param, hasNames)); |
||||
|
||||
return string.Join(", ", args); |
||||
} |
||||
|
||||
public string VisitParameter(Parameter param, bool hasName = true) |
||||
{ |
||||
Context.Parameter = param; |
||||
var type = param.Type.Visit(this, param.QualifiedType.Qualifiers); |
||||
Context.Parameter = null; |
||||
|
||||
var str = string.Empty; |
||||
if(param.Usage == ParameterUsage.Out) |
||||
str += "[System::Runtime::InteropServices::Out] "; |
||||
|
||||
str += type; |
||||
|
||||
if(param.Usage == ParameterUsage.Out || |
||||
param.Usage == ParameterUsage.InOut) |
||||
str += "%"; |
||||
|
||||
if (hasName && !string.IsNullOrEmpty(param.Name)) |
||||
str += " " + param.Name; |
||||
|
||||
return str; |
||||
} |
||||
|
||||
public string VisitDelegate(FunctionType function) |
||||
{ |
||||
return string.Format("delegate {0} {{0}}({1})", |
||||
function.ReturnType.Visit(this), |
||||
VisitParameters(function.Parameters, hasNames: true)); |
||||
} |
||||
|
||||
public string VisitPointerType(PointerType pointer, TypeQualifiers quals) |
||||
{ |
||||
var pointee = pointer.Pointee.Desugar(); |
||||
|
||||
if (pointee is FunctionType) |
||||
{ |
||||
var function = pointee as FunctionType; |
||||
return string.Format("{0}^", function.Visit(this, quals)); |
||||
} |
||||
|
||||
if (pointee.IsPrimitiveType(PrimitiveType.Char) && quals.IsConst) |
||||
{ |
||||
return "System::String^"; |
||||
} |
||||
|
||||
// From http://msdn.microsoft.com/en-us/library/y31yhkeb.aspx
|
||||
// Any of the following types may be a pointer type:
|
||||
// * sbyte, byte, short, ushort, int, uint, long, ulong, char, float, double, decimal, or bool.
|
||||
// * Any enum type.
|
||||
// * Any pointer type.
|
||||
// * Any user-defined struct type that contains fields of unmanaged types only.
|
||||
var finalPointee = pointer.GetFinalPointee(); |
||||
if (finalPointee.IsPrimitiveType()) |
||||
{ |
||||
// Skip one indirection if passed by reference
|
||||
var param = Context.Parameter; |
||||
if (param != null && (param.IsOut || param.IsInOut) |
||||
&& pointee == finalPointee) |
||||
return pointee.Visit(this, quals); |
||||
|
||||
return pointee.Visit(this, quals) + "*"; |
||||
} |
||||
|
||||
Enumeration @enum; |
||||
if (pointee.TryGetEnum(out @enum)) |
||||
{ |
||||
var typeName = @enum.Visit(this); |
||||
return string.Format("{0}*", typeName); |
||||
} |
||||
|
||||
return pointer.Pointee.Visit(this, quals); |
||||
} |
||||
|
||||
public string VisitMemberPointerType(MemberPointerType member, |
||||
TypeQualifiers quals) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitBuiltinType(BuiltinType builtin, TypeQualifiers quals) |
||||
{ |
||||
return VisitPrimitiveType(builtin.Type); |
||||
} |
||||
|
||||
public string VisitPrimitiveType(PrimitiveType primitive) |
||||
{ |
||||
switch (primitive) |
||||
{ |
||||
case PrimitiveType.Bool: return "bool"; |
||||
case PrimitiveType.Void: return "void"; |
||||
case PrimitiveType.Char16: |
||||
case PrimitiveType.WideChar: return "System::Char"; |
||||
case PrimitiveType.Int8: return Options.MarshalCharAsManagedChar ? "System::Char" : "char"; |
||||
case PrimitiveType.UInt8: return "unsigned char"; |
||||
case PrimitiveType.Int16: return "short"; |
||||
case PrimitiveType.UInt16: return "unsigned short"; |
||||
case PrimitiveType.Int32: return "int"; |
||||
case PrimitiveType.UInt32: return "unsigned int"; |
||||
case PrimitiveType.Int64: return "long long"; |
||||
case PrimitiveType.UInt64: return "unsigned long long"; |
||||
case PrimitiveType.Float: return "float"; |
||||
case PrimitiveType.Double: return "double"; |
||||
case PrimitiveType.IntPtr: return "IntPtr"; |
||||
case PrimitiveType.UIntPtr: return "UIntPtr"; |
||||
case PrimitiveType.Null: return "void*"; |
||||
} |
||||
|
||||
throw new NotSupportedException(); |
||||
} |
||||
|
||||
public string VisitTypedefType(TypedefType typedef, TypeQualifiers quals) |
||||
{ |
||||
var decl = typedef.Declaration; |
||||
|
||||
TypeMap typeMap = null; |
||||
if (TypeMapDatabase.FindTypeMap(decl, out typeMap)) |
||||
{ |
||||
typeMap.Type = typedef; |
||||
Context.Type = typedef; |
||||
return typeMap.CLISignature(Context); |
||||
} |
||||
|
||||
FunctionType func; |
||||
if (decl.Type.IsPointerTo<FunctionType>(out func)) |
||||
{ |
||||
// TODO: Use SafeIdentifier()
|
||||
return string.Format("{0}^", VisitDeclaration(decl)); |
||||
} |
||||
|
||||
return decl.Type.Visit(this); |
||||
} |
||||
|
||||
public string VisitAttributedType(AttributedType attributed, TypeQualifiers quals) |
||||
{ |
||||
return attributed.Modified.Visit(this); |
||||
} |
||||
|
||||
public string VisitDecayedType(DecayedType decayed, TypeQualifiers quals) |
||||
{ |
||||
return decayed.Decayed.Visit(this); |
||||
} |
||||
|
||||
public string VisitTemplateSpecializationType(TemplateSpecializationType template, |
||||
TypeQualifiers quals) |
||||
{ |
||||
var decl = template.Template.TemplatedDecl; |
||||
|
||||
TypeMap typeMap = null; |
||||
if (TypeMapDatabase.FindTypeMap(template, out typeMap)) |
||||
{ |
||||
typeMap.Declaration = decl; |
||||
typeMap.Type = template; |
||||
Context.Type = template; |
||||
return typeMap.CLISignature(Context); |
||||
} |
||||
|
||||
return decl.Name; |
||||
} |
||||
|
||||
public string VisitTemplateParameterType(TemplateParameterType param, |
||||
TypeQualifiers quals) |
||||
{ |
||||
return param.Parameter.Name; |
||||
} |
||||
|
||||
public string VisitTemplateParameterSubstitutionType( |
||||
TemplateParameterSubstitutionType param, TypeQualifiers quals) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitInjectedClassNameType(InjectedClassNameType injected, TypeQualifiers quals) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitDependentNameType(DependentNameType dependent, TypeQualifiers quals) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitPackExpansionType(PackExpansionType packExpansionType, TypeQualifiers quals) |
||||
{ |
||||
return string.Empty; |
||||
} |
||||
|
||||
public string VisitCILType(CILType type, TypeQualifiers quals) |
||||
{ |
||||
var result = type.Type.FullName.Replace(".", "::"); |
||||
if (!type.Type.IsValueType) |
||||
result += "^"; |
||||
return result; |
||||
} |
||||
|
||||
public string VisitPrimitiveType(PrimitiveType type, TypeQualifiers quals) |
||||
{ |
||||
return VisitPrimitiveType(type); |
||||
} |
||||
|
||||
public string VisitDeclaration(Declaration decl, TypeQualifiers quals) |
||||
{ |
||||
return VisitDeclaration(decl); |
||||
} |
||||
|
||||
public string VisitDeclaration(Declaration decl) |
||||
{ |
||||
var names = new List<string>(); |
||||
|
||||
if (Options.GenerateLibraryNamespace) |
||||
names.Add(Driver.Options.OutputNamespace); |
||||
|
||||
if (!string.IsNullOrEmpty(decl.Namespace.QualifiedName)) |
||||
names.Add(decl.Namespace.QualifiedName); |
||||
|
||||
names.Add(decl.Visit(this)); |
||||
|
||||
return string.Join("::", names); |
||||
} |
||||
|
||||
public string VisitClassDecl(Class @class) |
||||
{ |
||||
if (@class.CompleteDeclaration != null) |
||||
return VisitClassDecl(@class.CompleteDeclaration as Class); |
||||
|
||||
return string.Format("{0}{1}", @class.Name, @class.IsRefType ? "^" |
||||
: string.Empty); |
||||
} |
||||
|
||||
public string VisitFieldDecl(Field field) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitFunctionDecl(Function function) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitMethodDecl(Method method) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitParameterDecl(Parameter parameter) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitTypedefDecl(TypedefDecl typedef) |
||||
{ |
||||
return typedef.Name; |
||||
} |
||||
|
||||
public string VisitEnumDecl(Enumeration @enum) |
||||
{ |
||||
return @enum.Name; |
||||
} |
||||
|
||||
public string VisitVariableDecl(Variable variable) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitClassTemplateDecl(ClassTemplate template) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitFunctionTemplateDecl(FunctionTemplate template) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitMacroDefinition(MacroDefinition macro) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitNamespace(Namespace @namespace) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitEvent(Event @event) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitProperty(Property property) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string ToString(Type type) |
||||
{ |
||||
return type.Visit(this); |
||||
} |
||||
} |
||||
} |
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,27 +1,27 @@
@@ -1,27 +1,27 @@
|
||||
using CppSharp.AST; |
||||
using Interop = System.Runtime.InteropServices; |
||||
|
||||
namespace CppSharp.Generators |
||||
{ |
||||
public static class ExtensionMethods |
||||
{ |
||||
public static Interop.CallingConvention ToInteropCallConv(this CallingConvention convention) |
||||
{ |
||||
switch (convention) |
||||
{ |
||||
case CallingConvention.Default: |
||||
return Interop.CallingConvention.Winapi; |
||||
case CallingConvention.C: |
||||
return Interop.CallingConvention.Cdecl; |
||||
case CallingConvention.StdCall: |
||||
return Interop.CallingConvention.StdCall; |
||||
case CallingConvention.ThisCall: |
||||
return Interop.CallingConvention.ThisCall; |
||||
case CallingConvention.FastCall: |
||||
return Interop.CallingConvention.FastCall; |
||||
} |
||||
|
||||
return Interop.CallingConvention.Winapi; |
||||
} |
||||
} |
||||
} |
||||
using CppSharp.AST; |
||||
using Interop = System.Runtime.InteropServices; |
||||
|
||||
namespace CppSharp.Generators |
||||
{ |
||||
public static class ExtensionMethods |
||||
{ |
||||
public static Interop.CallingConvention ToInteropCallConv(this CallingConvention convention) |
||||
{ |
||||
switch (convention) |
||||
{ |
||||
case CallingConvention.Default: |
||||
return Interop.CallingConvention.Winapi; |
||||
case CallingConvention.C: |
||||
return Interop.CallingConvention.Cdecl; |
||||
case CallingConvention.StdCall: |
||||
return Interop.CallingConvention.StdCall; |
||||
case CallingConvention.ThisCall: |
||||
return Interop.CallingConvention.ThisCall; |
||||
case CallingConvention.FastCall: |
||||
return Interop.CallingConvention.FastCall; |
||||
} |
||||
|
||||
return Interop.CallingConvention.Winapi; |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,58 +1,58 @@
@@ -1,58 +1,58 @@
|
||||
using System.Linq; |
||||
using CppSharp.AST; |
||||
using CppSharp.AST.Extensions; |
||||
using CppSharp.Generators; |
||||
|
||||
namespace CppSharp.Passes |
||||
{ |
||||
/// <summary>
|
||||
/// This pass will create conversion operators out of single argument
|
||||
/// constructors.
|
||||
/// </summary>
|
||||
public class ConstructorToConversionOperatorPass : TranslationUnitPass |
||||
{ |
||||
public override bool VisitMethodDecl(Method method) |
||||
{ |
||||
if (!method.IsConstructor) |
||||
return false; |
||||
if (method.IsCopyConstructor) |
||||
return false; |
||||
if (method.Parameters.Count != 1) |
||||
return false; |
||||
var parameter = method.Parameters[0]; |
||||
var parameterType = parameter.Type as PointerType; |
||||
if (parameterType == null) |
||||
return false; |
||||
if (!parameterType.IsReference) |
||||
return false; |
||||
var qualifiedPointee = parameterType.QualifiedPointee; |
||||
Class castFromClass; |
||||
if (!qualifiedPointee.Type.TryGetClass(out castFromClass)) |
||||
return false; |
||||
var castToClass = method.OriginalNamespace as Class; |
||||
if (castToClass == null) |
||||
return false; |
||||
if (castFromClass == castToClass) |
||||
return false; |
||||
|
||||
var operatorKind = method.IsExplicit |
||||
? CXXOperatorKind.ExplicitConversion |
||||
: CXXOperatorKind.Conversion; |
||||
var castToType = new TagType(castToClass); |
||||
var qualifiedCastToType = new QualifiedType(castToType); |
||||
var conversionOperator = new Method() |
||||
{ |
||||
Name = Operators.GetOperatorIdentifier(operatorKind), |
||||
Namespace = castFromClass, |
||||
Kind = CXXMethodKind.Conversion, |
||||
IsSynthetized = true, |
||||
ConversionType = qualifiedCastToType, |
||||
ReturnType = qualifiedCastToType |
||||
}; |
||||
conversionOperator.OperatorKind = operatorKind; |
||||
|
||||
castFromClass.Methods.Add(conversionOperator); |
||||
return true; |
||||
} |
||||
} |
||||
} |
||||
using System.Linq; |
||||
using CppSharp.AST; |
||||
using CppSharp.AST.Extensions; |
||||
using CppSharp.Generators; |
||||
|
||||
namespace CppSharp.Passes |
||||
{ |
||||
/// <summary>
|
||||
/// This pass will create conversion operators out of single argument
|
||||
/// constructors.
|
||||
/// </summary>
|
||||
public class ConstructorToConversionOperatorPass : TranslationUnitPass |
||||
{ |
||||
public override bool VisitMethodDecl(Method method) |
||||
{ |
||||
if (!method.IsConstructor) |
||||
return false; |
||||
if (method.IsCopyConstructor) |
||||
return false; |
||||
if (method.Parameters.Count != 1) |
||||
return false; |
||||
var parameter = method.Parameters[0]; |
||||
var parameterType = parameter.Type as PointerType; |
||||
if (parameterType == null) |
||||
return false; |
||||
if (!parameterType.IsReference) |
||||
return false; |
||||
var qualifiedPointee = parameterType.QualifiedPointee; |
||||
Class castFromClass; |
||||
if (!qualifiedPointee.Type.TryGetClass(out castFromClass)) |
||||
return false; |
||||
var castToClass = method.OriginalNamespace as Class; |
||||
if (castToClass == null) |
||||
return false; |
||||
if (castFromClass == castToClass) |
||||
return false; |
||||
|
||||
var operatorKind = method.IsExplicit |
||||
? CXXOperatorKind.ExplicitConversion |
||||
: CXXOperatorKind.Conversion; |
||||
var castToType = new TagType(castToClass); |
||||
var qualifiedCastToType = new QualifiedType(castToType); |
||||
var conversionOperator = new Method() |
||||
{ |
||||
Name = Operators.GetOperatorIdentifier(operatorKind), |
||||
Namespace = castFromClass, |
||||
Kind = CXXMethodKind.Conversion, |
||||
IsSynthetized = true, |
||||
ConversionType = qualifiedCastToType, |
||||
ReturnType = qualifiedCastToType |
||||
}; |
||||
conversionOperator.OperatorKind = operatorKind; |
||||
|
||||
castFromClass.Methods.Add(conversionOperator); |
||||
return true; |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,330 +1,330 @@
@@ -1,330 +1,330 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using CppSharp.AST; |
||||
using Type = CppSharp.AST.Type; |
||||
|
||||
namespace CppSharp.Types |
||||
{ |
||||
public enum CppTypePrintScopeKind |
||||
{ |
||||
Local, |
||||
Qualified, |
||||
GlobalQualified |
||||
} |
||||
|
||||
public class CppTypePrinter : ITypePrinter<string>, IDeclVisitor<string> |
||||
{ |
||||
public CppTypePrintScopeKind PrintScopeKind; |
||||
public bool PrintLogicalNames; |
||||
public bool PrintTypeQualifiers; |
||||
|
||||
public CppTypePrinter(ITypeMapDatabase database, bool printTypeQualifiers = true) |
||||
{ |
||||
PrintScopeKind = CppTypePrintScopeKind.GlobalQualified; |
||||
PrintTypeQualifiers = printTypeQualifiers; |
||||
} |
||||
|
||||
public string VisitTagType(TagType tag, TypeQualifiers quals) |
||||
{ |
||||
return tag.Declaration.Visit(this); |
||||
} |
||||
|
||||
public string VisitArrayType(ArrayType array, TypeQualifiers quals) |
||||
{ |
||||
var typeName = array.Type.Visit(this); |
||||
|
||||
switch (array.SizeType) |
||||
{ |
||||
case ArrayType.ArraySize.Constant: |
||||
return string.Format("{0}[{1}]", typeName, array.Size); |
||||
case ArrayType.ArraySize.Variable: |
||||
case ArrayType.ArraySize.Dependent: |
||||
case ArrayType.ArraySize.Incomplete: |
||||
return string.Format("{0}[]", typeName); |
||||
} |
||||
|
||||
throw new NotSupportedException(); |
||||
} |
||||
|
||||
static string ConvertModifierToString(PointerType.TypeModifier modifier) |
||||
{ |
||||
switch (modifier) |
||||
{ |
||||
case PointerType.TypeModifier.Value: return string.Empty; |
||||
case PointerType.TypeModifier.Pointer: return "*"; |
||||
case PointerType.TypeModifier.LVReference: return "&"; |
||||
case PointerType.TypeModifier.RVReference: return "&&"; |
||||
} |
||||
|
||||
return string.Empty; |
||||
} |
||||
|
||||
public string VisitPointerType(PointerType pointer, TypeQualifiers quals) |
||||
{ |
||||
var pointee = pointer.Pointee; |
||||
|
||||
var function = pointee as FunctionType; |
||||
if (function != null) |
||||
{ |
||||
var arguments = function.Parameters; |
||||
var returnType = function.ReturnType; |
||||
var args = string.Empty; |
||||
|
||||
if (arguments.Count > 0) |
||||
args = VisitParameters(function.Parameters, hasNames: false); |
||||
|
||||
return string.Format("{0} (*)({1})", returnType.Visit(this), args); |
||||
} |
||||
|
||||
var pointeeType = pointer.Pointee.Visit(this, quals); |
||||
var mod = ConvertModifierToString(pointer.Modifier); |
||||
|
||||
var s = PrintTypeQualifiers && quals.IsConst ? "const " : string.Empty; |
||||
s += string.Format("{0}{1}", pointeeType, mod); |
||||
|
||||
return s; |
||||
} |
||||
|
||||
public string VisitMemberPointerType(MemberPointerType member, TypeQualifiers quals) |
||||
{ |
||||
return string.Empty; |
||||
} |
||||
|
||||
public string VisitBuiltinType(BuiltinType builtin, TypeQualifiers quals) |
||||
{ |
||||
return VisitPrimitiveType(builtin.Type); |
||||
} |
||||
|
||||
public string VisitPrimitiveType(PrimitiveType primitive) |
||||
{ |
||||
switch (primitive) |
||||
{ |
||||
case PrimitiveType.Bool: return "bool"; |
||||
case PrimitiveType.Void: return "void"; |
||||
case PrimitiveType.Char16: |
||||
case PrimitiveType.WideChar: return "char"; |
||||
case PrimitiveType.Int8: return "char"; |
||||
case PrimitiveType.UInt8: return "unsigned char"; |
||||
case PrimitiveType.Int16: return "short"; |
||||
case PrimitiveType.UInt16: return "unsigned short"; |
||||
case PrimitiveType.Int32: return "int"; |
||||
case PrimitiveType.UInt32: return "unsigned int"; |
||||
case PrimitiveType.Int64: return "long long"; |
||||
case PrimitiveType.UInt64: return "unsigned long long"; |
||||
case PrimitiveType.Float: return "float"; |
||||
case PrimitiveType.Double: return "double"; |
||||
case PrimitiveType.IntPtr: return "void*"; |
||||
case PrimitiveType.UIntPtr: return "uintptr_t"; |
||||
case PrimitiveType.Null: return "std::nullptr_t"; |
||||
} |
||||
|
||||
throw new NotSupportedException(); |
||||
} |
||||
|
||||
public string VisitTypedefType(TypedefType typedef, TypeQualifiers quals) |
||||
{ |
||||
return GetDeclName(typedef.Declaration); |
||||
} |
||||
|
||||
public string VisitAttributedType(AttributedType attributed, TypeQualifiers quals) |
||||
{ |
||||
return attributed.Modified.Visit(this); |
||||
} |
||||
|
||||
public string VisitDecayedType(DecayedType decayed, TypeQualifiers quals) |
||||
{ |
||||
return decayed.Decayed.Visit(this); |
||||
} |
||||
|
||||
public string VisitTemplateSpecializationType(TemplateSpecializationType template, TypeQualifiers quals) |
||||
{ |
||||
return string.Format("{0}<{1}>", template.Template.TemplatedDecl.Visit(this), |
||||
string.Join(", ", |
||||
template.Arguments.Where( |
||||
a => a.Type.Type != null && |
||||
!(a.Type.Type is DependentNameType)).Select(a => a.Type.Visit(this)))); |
||||
} |
||||
|
||||
public string VisitTemplateParameterType(TemplateParameterType param, TypeQualifiers quals) |
||||
{ |
||||
if (param.Parameter.Name == null) |
||||
return string.Empty; |
||||
|
||||
return param.Parameter.Name; |
||||
} |
||||
|
||||
public string VisitTemplateParameterSubstitutionType( |
||||
TemplateParameterSubstitutionType param, TypeQualifiers quals) |
||||
{ |
||||
return param.Replacement.Visit(this); |
||||
} |
||||
|
||||
public string VisitInjectedClassNameType(InjectedClassNameType injected, TypeQualifiers quals) |
||||
{ |
||||
return injected.Class.Visit(this); |
||||
} |
||||
|
||||
public string VisitDependentNameType(DependentNameType dependent, TypeQualifiers quals) |
||||
{ |
||||
throw new System.NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitPackExpansionType(PackExpansionType packExpansionType, TypeQualifiers quals) |
||||
{ |
||||
return string.Empty; |
||||
} |
||||
|
||||
public string VisitCILType(CILType type, TypeQualifiers quals) |
||||
{ |
||||
return string.Empty; |
||||
} |
||||
|
||||
public string VisitPrimitiveType(PrimitiveType type, TypeQualifiers quals) |
||||
{ |
||||
throw new System.NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitDeclaration(Declaration decl, TypeQualifiers quals) |
||||
{ |
||||
throw new System.NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitFunctionType(FunctionType function, TypeQualifiers quals) |
||||
{ |
||||
var arguments = function.Parameters; |
||||
var returnType = function.ReturnType; |
||||
var args = string.Empty; |
||||
|
||||
if (arguments.Count > 0) |
||||
args = VisitParameters(function.Parameters, hasNames: false); |
||||
|
||||
return string.Format("{0} ({1})", returnType.Visit(this), args); |
||||
} |
||||
|
||||
public string VisitParameters(IEnumerable<Parameter> @params, |
||||
bool hasNames) |
||||
{ |
||||
var args = new List<string>(); |
||||
|
||||
foreach (var param in @params) |
||||
args.Add(VisitParameter(param, hasNames)); |
||||
|
||||
return string.Join(", ", args); |
||||
} |
||||
|
||||
public string VisitParameter(Parameter arg, bool hasName = true) |
||||
{ |
||||
var type = arg.Type.Visit(this, arg.QualifiedType.Qualifiers); |
||||
var name = arg.Name; |
||||
|
||||
if (hasName && !string.IsNullOrEmpty(name)) |
||||
return string.Format("{0} {1}", type, name); |
||||
|
||||
return type; |
||||
} |
||||
|
||||
public string VisitDelegate(FunctionType function) |
||||
{ |
||||
throw new System.NotImplementedException(); |
||||
} |
||||
|
||||
public string GetDeclName(Declaration declaration) |
||||
{ |
||||
switch (PrintScopeKind) |
||||
{ |
||||
case CppTypePrintScopeKind.Local: |
||||
return PrintLogicalNames ? declaration.LogicalOriginalName |
||||
: declaration.OriginalName; |
||||
case CppTypePrintScopeKind.Qualified: |
||||
return PrintLogicalNames ? declaration.QualifiedLogicalOriginalName |
||||
: declaration.QualifiedOriginalName; |
||||
case CppTypePrintScopeKind.GlobalQualified: |
||||
return "::" + (PrintLogicalNames ? declaration.QualifiedLogicalOriginalName |
||||
: declaration.QualifiedOriginalName); |
||||
} |
||||
|
||||
throw new NotSupportedException(); |
||||
} |
||||
|
||||
public string VisitDeclaration(Declaration decl) |
||||
{ |
||||
return GetDeclName(decl); |
||||
} |
||||
|
||||
public string VisitClassDecl(Class @class) |
||||
{ |
||||
return VisitDeclaration(@class); |
||||
} |
||||
|
||||
public string VisitFieldDecl(Field field) |
||||
{ |
||||
return VisitDeclaration(field); |
||||
} |
||||
|
||||
public string VisitFunctionDecl(Function function) |
||||
{ |
||||
return VisitDeclaration(function); |
||||
} |
||||
|
||||
public string VisitMethodDecl(Method method) |
||||
{ |
||||
return VisitDeclaration(method); |
||||
} |
||||
|
||||
public string VisitParameterDecl(Parameter parameter) |
||||
{ |
||||
return VisitParameter(parameter, hasName: false); |
||||
} |
||||
|
||||
public string VisitTypedefDecl(TypedefDecl typedef) |
||||
{ |
||||
return VisitDeclaration(typedef); |
||||
} |
||||
|
||||
public string VisitEnumDecl(Enumeration @enum) |
||||
{ |
||||
return VisitDeclaration(@enum); |
||||
} |
||||
|
||||
public string VisitVariableDecl(Variable variable) |
||||
{ |
||||
return VisitDeclaration(variable); |
||||
} |
||||
|
||||
public string VisitClassTemplateDecl(ClassTemplate template) |
||||
{ |
||||
return VisitDeclaration(template); |
||||
} |
||||
|
||||
public string VisitFunctionTemplateDecl(FunctionTemplate template) |
||||
{ |
||||
return VisitDeclaration(template); |
||||
} |
||||
|
||||
public string VisitMacroDefinition(MacroDefinition macro) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitNamespace(Namespace @namespace) |
||||
{ |
||||
return VisitDeclaration(@namespace); |
||||
} |
||||
|
||||
public string VisitEvent(Event @event) |
||||
{ |
||||
return string.Empty; |
||||
} |
||||
|
||||
public string VisitProperty(Property property) |
||||
{ |
||||
return VisitDeclaration(property); |
||||
} |
||||
|
||||
public string ToString(Type type) |
||||
{ |
||||
return type.Visit(this); |
||||
} |
||||
} |
||||
} |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using CppSharp.AST; |
||||
using Type = CppSharp.AST.Type; |
||||
|
||||
namespace CppSharp.Types |
||||
{ |
||||
public enum CppTypePrintScopeKind |
||||
{ |
||||
Local, |
||||
Qualified, |
||||
GlobalQualified |
||||
} |
||||
|
||||
public class CppTypePrinter : ITypePrinter<string>, IDeclVisitor<string> |
||||
{ |
||||
public CppTypePrintScopeKind PrintScopeKind; |
||||
public bool PrintLogicalNames; |
||||
public bool PrintTypeQualifiers; |
||||
|
||||
public CppTypePrinter(ITypeMapDatabase database, bool printTypeQualifiers = true) |
||||
{ |
||||
PrintScopeKind = CppTypePrintScopeKind.GlobalQualified; |
||||
PrintTypeQualifiers = printTypeQualifiers; |
||||
} |
||||
|
||||
public string VisitTagType(TagType tag, TypeQualifiers quals) |
||||
{ |
||||
return tag.Declaration.Visit(this); |
||||
} |
||||
|
||||
public string VisitArrayType(ArrayType array, TypeQualifiers quals) |
||||
{ |
||||
var typeName = array.Type.Visit(this); |
||||
|
||||
switch (array.SizeType) |
||||
{ |
||||
case ArrayType.ArraySize.Constant: |
||||
return string.Format("{0}[{1}]", typeName, array.Size); |
||||
case ArrayType.ArraySize.Variable: |
||||
case ArrayType.ArraySize.Dependent: |
||||
case ArrayType.ArraySize.Incomplete: |
||||
return string.Format("{0}[]", typeName); |
||||
} |
||||
|
||||
throw new NotSupportedException(); |
||||
} |
||||
|
||||
static string ConvertModifierToString(PointerType.TypeModifier modifier) |
||||
{ |
||||
switch (modifier) |
||||
{ |
||||
case PointerType.TypeModifier.Value: return string.Empty; |
||||
case PointerType.TypeModifier.Pointer: return "*"; |
||||
case PointerType.TypeModifier.LVReference: return "&"; |
||||
case PointerType.TypeModifier.RVReference: return "&&"; |
||||
} |
||||
|
||||
return string.Empty; |
||||
} |
||||
|
||||
public string VisitPointerType(PointerType pointer, TypeQualifiers quals) |
||||
{ |
||||
var pointee = pointer.Pointee; |
||||
|
||||
var function = pointee as FunctionType; |
||||
if (function != null) |
||||
{ |
||||
var arguments = function.Parameters; |
||||
var returnType = function.ReturnType; |
||||
var args = string.Empty; |
||||
|
||||
if (arguments.Count > 0) |
||||
args = VisitParameters(function.Parameters, hasNames: false); |
||||
|
||||
return string.Format("{0} (*)({1})", returnType.Visit(this), args); |
||||
} |
||||
|
||||
var pointeeType = pointer.Pointee.Visit(this, quals); |
||||
var mod = ConvertModifierToString(pointer.Modifier); |
||||
|
||||
var s = PrintTypeQualifiers && quals.IsConst ? "const " : string.Empty; |
||||
s += string.Format("{0}{1}", pointeeType, mod); |
||||
|
||||
return s; |
||||
} |
||||
|
||||
public string VisitMemberPointerType(MemberPointerType member, TypeQualifiers quals) |
||||
{ |
||||
return string.Empty; |
||||
} |
||||
|
||||
public string VisitBuiltinType(BuiltinType builtin, TypeQualifiers quals) |
||||
{ |
||||
return VisitPrimitiveType(builtin.Type); |
||||
} |
||||
|
||||
public string VisitPrimitiveType(PrimitiveType primitive) |
||||
{ |
||||
switch (primitive) |
||||
{ |
||||
case PrimitiveType.Bool: return "bool"; |
||||
case PrimitiveType.Void: return "void"; |
||||
case PrimitiveType.Char16: |
||||
case PrimitiveType.WideChar: return "char"; |
||||
case PrimitiveType.Int8: return "char"; |
||||
case PrimitiveType.UInt8: return "unsigned char"; |
||||
case PrimitiveType.Int16: return "short"; |
||||
case PrimitiveType.UInt16: return "unsigned short"; |
||||
case PrimitiveType.Int32: return "int"; |
||||
case PrimitiveType.UInt32: return "unsigned int"; |
||||
case PrimitiveType.Int64: return "long long"; |
||||
case PrimitiveType.UInt64: return "unsigned long long"; |
||||
case PrimitiveType.Float: return "float"; |
||||
case PrimitiveType.Double: return "double"; |
||||
case PrimitiveType.IntPtr: return "void*"; |
||||
case PrimitiveType.UIntPtr: return "uintptr_t"; |
||||
case PrimitiveType.Null: return "std::nullptr_t"; |
||||
} |
||||
|
||||
throw new NotSupportedException(); |
||||
} |
||||
|
||||
public string VisitTypedefType(TypedefType typedef, TypeQualifiers quals) |
||||
{ |
||||
return GetDeclName(typedef.Declaration); |
||||
} |
||||
|
||||
public string VisitAttributedType(AttributedType attributed, TypeQualifiers quals) |
||||
{ |
||||
return attributed.Modified.Visit(this); |
||||
} |
||||
|
||||
public string VisitDecayedType(DecayedType decayed, TypeQualifiers quals) |
||||
{ |
||||
return decayed.Decayed.Visit(this); |
||||
} |
||||
|
||||
public string VisitTemplateSpecializationType(TemplateSpecializationType template, TypeQualifiers quals) |
||||
{ |
||||
return string.Format("{0}<{1}>", template.Template.TemplatedDecl.Visit(this), |
||||
string.Join(", ", |
||||
template.Arguments.Where( |
||||
a => a.Type.Type != null && |
||||
!(a.Type.Type is DependentNameType)).Select(a => a.Type.Visit(this)))); |
||||
} |
||||
|
||||
public string VisitTemplateParameterType(TemplateParameterType param, TypeQualifiers quals) |
||||
{ |
||||
if (param.Parameter.Name == null) |
||||
return string.Empty; |
||||
|
||||
return param.Parameter.Name; |
||||
} |
||||
|
||||
public string VisitTemplateParameterSubstitutionType( |
||||
TemplateParameterSubstitutionType param, TypeQualifiers quals) |
||||
{ |
||||
return param.Replacement.Visit(this); |
||||
} |
||||
|
||||
public string VisitInjectedClassNameType(InjectedClassNameType injected, TypeQualifiers quals) |
||||
{ |
||||
return injected.Class.Visit(this); |
||||
} |
||||
|
||||
public string VisitDependentNameType(DependentNameType dependent, TypeQualifiers quals) |
||||
{ |
||||
throw new System.NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitPackExpansionType(PackExpansionType packExpansionType, TypeQualifiers quals) |
||||
{ |
||||
return string.Empty; |
||||
} |
||||
|
||||
public string VisitCILType(CILType type, TypeQualifiers quals) |
||||
{ |
||||
return string.Empty; |
||||
} |
||||
|
||||
public string VisitPrimitiveType(PrimitiveType type, TypeQualifiers quals) |
||||
{ |
||||
throw new System.NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitDeclaration(Declaration decl, TypeQualifiers quals) |
||||
{ |
||||
throw new System.NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitFunctionType(FunctionType function, TypeQualifiers quals) |
||||
{ |
||||
var arguments = function.Parameters; |
||||
var returnType = function.ReturnType; |
||||
var args = string.Empty; |
||||
|
||||
if (arguments.Count > 0) |
||||
args = VisitParameters(function.Parameters, hasNames: false); |
||||
|
||||
return string.Format("{0} ({1})", returnType.Visit(this), args); |
||||
} |
||||
|
||||
public string VisitParameters(IEnumerable<Parameter> @params, |
||||
bool hasNames) |
||||
{ |
||||
var args = new List<string>(); |
||||
|
||||
foreach (var param in @params) |
||||
args.Add(VisitParameter(param, hasNames)); |
||||
|
||||
return string.Join(", ", args); |
||||
} |
||||
|
||||
public string VisitParameter(Parameter arg, bool hasName = true) |
||||
{ |
||||
var type = arg.Type.Visit(this, arg.QualifiedType.Qualifiers); |
||||
var name = arg.Name; |
||||
|
||||
if (hasName && !string.IsNullOrEmpty(name)) |
||||
return string.Format("{0} {1}", type, name); |
||||
|
||||
return type; |
||||
} |
||||
|
||||
public string VisitDelegate(FunctionType function) |
||||
{ |
||||
throw new System.NotImplementedException(); |
||||
} |
||||
|
||||
public string GetDeclName(Declaration declaration) |
||||
{ |
||||
switch (PrintScopeKind) |
||||
{ |
||||
case CppTypePrintScopeKind.Local: |
||||
return PrintLogicalNames ? declaration.LogicalOriginalName |
||||
: declaration.OriginalName; |
||||
case CppTypePrintScopeKind.Qualified: |
||||
return PrintLogicalNames ? declaration.QualifiedLogicalOriginalName |
||||
: declaration.QualifiedOriginalName; |
||||
case CppTypePrintScopeKind.GlobalQualified: |
||||
return "::" + (PrintLogicalNames ? declaration.QualifiedLogicalOriginalName |
||||
: declaration.QualifiedOriginalName); |
||||
} |
||||
|
||||
throw new NotSupportedException(); |
||||
} |
||||
|
||||
public string VisitDeclaration(Declaration decl) |
||||
{ |
||||
return GetDeclName(decl); |
||||
} |
||||
|
||||
public string VisitClassDecl(Class @class) |
||||
{ |
||||
return VisitDeclaration(@class); |
||||
} |
||||
|
||||
public string VisitFieldDecl(Field field) |
||||
{ |
||||
return VisitDeclaration(field); |
||||
} |
||||
|
||||
public string VisitFunctionDecl(Function function) |
||||
{ |
||||
return VisitDeclaration(function); |
||||
} |
||||
|
||||
public string VisitMethodDecl(Method method) |
||||
{ |
||||
return VisitDeclaration(method); |
||||
} |
||||
|
||||
public string VisitParameterDecl(Parameter parameter) |
||||
{ |
||||
return VisitParameter(parameter, hasName: false); |
||||
} |
||||
|
||||
public string VisitTypedefDecl(TypedefDecl typedef) |
||||
{ |
||||
return VisitDeclaration(typedef); |
||||
} |
||||
|
||||
public string VisitEnumDecl(Enumeration @enum) |
||||
{ |
||||
return VisitDeclaration(@enum); |
||||
} |
||||
|
||||
public string VisitVariableDecl(Variable variable) |
||||
{ |
||||
return VisitDeclaration(variable); |
||||
} |
||||
|
||||
public string VisitClassTemplateDecl(ClassTemplate template) |
||||
{ |
||||
return VisitDeclaration(template); |
||||
} |
||||
|
||||
public string VisitFunctionTemplateDecl(FunctionTemplate template) |
||||
{ |
||||
return VisitDeclaration(template); |
||||
} |
||||
|
||||
public string VisitMacroDefinition(MacroDefinition macro) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string VisitNamespace(Namespace @namespace) |
||||
{ |
||||
return VisitDeclaration(@namespace); |
||||
} |
||||
|
||||
public string VisitEvent(Event @event) |
||||
{ |
||||
return string.Empty; |
||||
} |
||||
|
||||
public string VisitProperty(Property property) |
||||
{ |
||||
return VisitDeclaration(property); |
||||
} |
||||
|
||||
public string ToString(Type type) |
||||
{ |
||||
return type.Visit(this); |
||||
} |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue