|
|
@ -75,20 +75,18 @@ namespace CppSharp.AST |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// Finds an existing struct/class in the library modules.
|
|
|
|
/// Finds an existing struct/class in the library modules.
|
|
|
|
public IEnumerable<Class> FindClass(string name, bool create = false, |
|
|
|
public IEnumerable<Class> FindClass(string name, bool create = false) |
|
|
|
bool ignoreCase = false) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
return TranslationUnits.Select( |
|
|
|
return TranslationUnits.Select( |
|
|
|
module => module.FindClass(name, |
|
|
|
module => module.FindClass(name)) |
|
|
|
ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal)) |
|
|
|
|
|
|
|
.Where(type => type != null); |
|
|
|
.Where(type => type != null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// Finds the complete declaration of a class.
|
|
|
|
/// Finds the complete declaration of a class.
|
|
|
|
public Class FindCompleteClass(string name, bool ignoreCase = false) |
|
|
|
public Class FindCompleteClass(string name) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return FindClass(name, ignoreCase: ignoreCase).FirstOrDefault( |
|
|
|
return FindClass(name) |
|
|
|
@class => !@class.IsIncomplete); |
|
|
|
.FirstOrDefault(@class => !@class.IsIncomplete); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// Finds an existing function in the library modules.
|
|
|
|
/// Finds an existing function in the library modules.
|
|
|
|