Browse Source

Added better support for dependent name types.

pull/1/head
triton 13 years ago
parent
commit
440ed5b92f
  1. 5
      src/Bridge/ASTVisitor.cs
  2. 19
      src/Bridge/Type.cs
  3. 5
      src/Generator/Generators/CLI/CLITypePrinter.cs
  4. 4
      src/Generator/Generators/CSharp/CSharpTypePrinter.cs
  5. 5
      src/Generator/Types/CppTypePrinter.cs
  6. 3
      src/Parser/Parser.cpp

5
src/Bridge/ASTVisitor.cs

@ -135,6 +135,11 @@ namespace CppSharp @@ -135,6 +135,11 @@ namespace CppSharp
return true;
}
public bool VisitDependentNameType(DependentNameType dependent, TypeQualifiers quals)
{
return true;
}
public virtual bool VisitPrimitiveType(PrimitiveType type, TypeQualifiers quals)
{
return true;

19
src/Bridge/Type.cs

@ -411,6 +411,23 @@ namespace CppSharp @@ -411,6 +411,23 @@ namespace CppSharp
}
}
/// <summary>
/// Represents a qualified type name for which the type name is dependent.
/// </summary>
public class DependentNameType : Type
{
public DependentNameType()
{
}
public override T Visit<T>(ITypeVisitor<T> visitor,
TypeQualifiers quals = new TypeQualifiers())
{
return visitor.VisitDependentNameType(this, quals);
}
}
#region Primitives
/// <summary>
@ -479,5 +496,7 @@ namespace CppSharp @@ -479,5 +496,7 @@ namespace CppSharp
TypeQualifiers quals);
T VisitInjectedClassNameType(InjectedClassNameType injected,
TypeQualifiers quals);
T VisitDependentNameType(DependentNameType dependent,
TypeQualifiers quals);
}
}

5
src/Generator/Generators/CLI/CLITypePrinter.cs

@ -222,6 +222,11 @@ namespace CppSharp.Generators.CLI @@ -222,6 +222,11 @@ namespace CppSharp.Generators.CLI
throw new NotImplementedException();
}
public string VisitDependentNameType(DependentNameType dependent, TypeQualifiers quals)
{
throw new NotImplementedException();
}
public string VisitPrimitiveType(PrimitiveType type, TypeQualifiers quals)
{
return VisitPrimitiveType(type);

4
src/Generator/Generators/CSharp/CSharpTypePrinter.cs

@ -242,6 +242,10 @@ namespace CppSharp.Generators.CSharp @@ -242,6 +242,10 @@ namespace CppSharp.Generators.CSharp
}
public CSharpTypePrinterResult VisitInjectedClassNameType(InjectedClassNameType injected, TypeQualifiers quals)
{
}
public CSharpTypePrinterResult VisitDependentNameType(DependentNameType dependent, TypeQualifiers quals)
{
throw new NotImplementedException();
}

5
src/Generator/Types/CppTypePrinter.cs

@ -112,6 +112,11 @@ namespace CppSharp.Types @@ -112,6 +112,11 @@ namespace CppSharp.Types
throw new System.NotImplementedException();
}
public string VisitDependentNameType(DependentNameType dependent, TypeQualifiers quals)
{
throw new System.NotImplementedException();
}
public string VisitPrimitiveType(PrimitiveType type, TypeQualifiers quals)
{
throw new System.NotImplementedException();

3
src/Parser/Parser.cpp

@ -976,7 +976,8 @@ CppSharp::Type^ Parser::WalkType(clang::QualType QualType, clang::TypeLoc* TL, @@ -976,7 +976,8 @@ CppSharp::Type^ Parser::WalkType(clang::QualType QualType, clang::TypeLoc* TL,
case Type::DependentName:
{
auto DN = Type->getAs<DependentNameType>();
return nullptr;
auto DNT = gcnew CppSharp::DependentNameType();
return DNT;
}
case Type::LValueReference:
{

Loading…
Cancel
Save