Browse Source

Fixed generation of static methods by processing it right in the parser and generator.

pull/1/head
triton 13 years ago
parent
commit
3da1199e3d
  1. 3
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs
  2. 1
      src/Parser/Parser.cpp

3
src/Generator/Generators/CSharp/CSharpTextTemplate.cs

@ -869,7 +869,8 @@ namespace CppSharp.Generators.CSharp @@ -869,7 +869,8 @@ namespace CppSharp.Generators.CSharp
Write("public ");
if (method.Kind == CXXMethodKind.Operator)
if (method.IsStatic ||
method.Kind == CXXMethodKind.Operator)
Write("static ");
var functionName = GetFunctionIdentifier(method, @class);

1
src/Parser/Parser.cpp

@ -560,6 +560,7 @@ CppSharp::Method^ Parser::WalkMethodCXX(clang::CXXMethodDecl* MD) @@ -560,6 +560,7 @@ CppSharp::Method^ Parser::WalkMethodCXX(clang::CXXMethodDecl* MD)
Method->Access = ConvertToAccess(MD->getAccess());
Method->Kind = GetMethodKindFromDecl(Name);
Method->OperatorKind = GetOperatorKindFromDecl(Name);
Method->IsStatic = MD->isStatic();
WalkFunction(MD, Method);

Loading…
Cancel
Save