Browse Source

Ignored private types.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/50/head
Dimitar Dobrev 12 years ago
parent
commit
bb07a294f4
  1. 2
      src/AST/Class.cs
  2. 2
      src/AST/Declaration.cs
  3. 1
      src/AST/Field.cs
  4. 1
      src/AST/Method.cs
  5. 2
      src/AST/Variable.cs
  6. 12
      src/Generator/Passes/CheckIgnoredDecls.cs
  7. 1
      src/Parser/Parser.cpp
  8. 9
      tests/Basic/Basic.h

2
src/AST/Class.cs

@ -15,8 +15,6 @@ namespace CppSharp.AST @@ -15,8 +15,6 @@ namespace CppSharp.AST
// A C++ access specifier declaration.
public class AccessSpecifierDecl : Declaration
{
public AccessSpecifier Access;
public override T Visit<T>(IDeclVisitor<T> visitor)
{
throw new NotImplementedException();

2
src/AST/Declaration.cs

@ -169,6 +169,8 @@ namespace CppSharp.AST @@ -169,6 +169,8 @@ namespace CppSharp.AST
}
}
public AccessSpecifier Access { get; set; }
// Contains debug text about the declaration.
public string DebugText;

1
src/AST/Field.cs

@ -8,7 +8,6 @@ namespace CppSharp.AST @@ -8,7 +8,6 @@ namespace CppSharp.AST
public Type Type { get { return QualifiedType.Type; } }
public QualifiedType QualifiedType { get; set; }
public AccessSpecifier Access { get; set; }
public uint Offset { get; set; }
public Class Class { get; set; }

1
src/AST/Method.cs

@ -74,7 +74,6 @@ namespace CppSharp.AST @@ -74,7 +74,6 @@ namespace CppSharp.AST
Access = AccessSpecifier.Public;
}
public AccessSpecifier Access { get; set; }
public AccessSpecifierDecl AccessDecl { get; set; }
public bool IsVirtual { get; set; }

2
src/AST/Variable.cs

@ -8,8 +8,6 @@ namespace CppSharp.AST @@ -8,8 +8,6 @@ namespace CppSharp.AST
return visitor.VisitVariableDecl(this);
}
public AccessSpecifier Access { get; set; }
public Type Type { get { return QualifiedType.Type; } }
public QualifiedType QualifiedType { get; set; }

12
src/Generator/Passes/CheckIgnoredDecls.cs

@ -24,6 +24,16 @@ namespace CppSharp.Passes @@ -24,6 +24,16 @@ namespace CppSharp.Passes
return true;
}
public override bool VisitClassDecl(Class @class)
{
if (@class.Access == AccessSpecifier.Private)
{
@class.ExplicityIgnored = true;
return false;
}
return base.VisitClassDecl(@class);
}
public override bool VisitFieldDecl(Field field)
{
if (!VisitDeclaration(field))
@ -86,7 +96,7 @@ namespace CppSharp.Passes @@ -86,7 +96,7 @@ namespace CppSharp.Passes
if (!VisitDeclaration(method))
return false;
if (method.Access != AccessSpecifier.Public)
if (method.Access == AccessSpecifier.Private)
{
method.ExplicityIgnored = true;
return false;

1
src/Parser/Parser.cpp

@ -2086,6 +2086,7 @@ CppSharp::AST::Declaration^ Parser::WalkDeclaration(clang::Decl* D, @@ -2086,6 +2086,7 @@ CppSharp::AST::Declaration^ Parser::WalkDeclaration(clang::Decl* D,
if (const ValueDecl *VD = dyn_cast_or_null<ValueDecl>(D))
Decl->IsDependent = VD->getType()->isDependentType();
Decl->Access = ConvertToAccess(D->getAccess());
}
return Decl;

9
tests/Basic/Basic.h

@ -49,12 +49,17 @@ enum Enum @@ -49,12 +49,17 @@ enum Enum
class DLL_API Hello
{
union {
union NestedPrivate {
int i;
float b;
float f;
};
public:
union NestedPublic {
int j;
float g;
};
Hello ();
void PrintHello(const char* s);

Loading…
Cancel
Save