void UGatherTextFromMetaDataCommandlet::GatherTextFromUObjects(const TArray<FString>& IncludePaths, const TArray<FString>& ExcludePaths, const FGatherParameters& Arguments) { const FFuzzyPathMatcher FuzzyPathMatcher = FFuzzyPathMatcher(IncludePaths, ExcludePaths); for(TObjectIterator<UField> It; It; ++It) { // Skip editor-only properties if we're not gathering for editor-only data. UProperty* Property = Cast<UProperty>(*It); if (Property && !ShouldGatherFromEditorOnlyData && Property->HasAnyPropertyFlags(CPF_EditorOnly)) { continue; } FString SourceFilePath; FSourceCodeNavigation::FindClassHeaderPath(*It, SourceFilePath); SourceFilePath = FPaths::ConvertRelativePathToFull(SourceFilePath); check(!SourceFilePath.IsEmpty()); const FFuzzyPathMatcher::EPathMatch PathMatch = FuzzyPathMatcher.TestPath(SourceFilePath); if (PathMatch != FFuzzyPathMatcher::Included) { continue; } GatherTextFromUObject(*It, Arguments); } }
void UGatherTextFromMetaDataCommandlet::GatherTextFromUObjects(const TArray<FString>& IncludePaths, const TArray<FString>& ExcludePaths, const FGatherParameters& Arguments) { for(TObjectIterator<UField> It; It; ++It) { // Skip editor-only properties if we're not gathering for editor-only data. UProperty* Property = Cast<UProperty>(*It); if (Property && !ShouldGatherFromEditorOnlyData && Property->HasAnyPropertyFlags(CPF_EditorOnly)) { continue; } FString SourceFilePath; FSourceCodeNavigation::FindClassHeaderPath(*It, SourceFilePath); SourceFilePath = FPaths::ConvertRelativePathToFull(SourceFilePath); check(!SourceFilePath.IsEmpty()); // Returns true if in an include path. False otherwise. auto IncludePathLogic = [&]() -> bool { for(int32 i = 0; i < IncludePaths.Num(); ++i) { if(SourceFilePath.MatchesWildcard(IncludePaths[i])) { return true; } } return false; }; if(!IncludePathLogic()) { continue; } // Returns true if in an exclude path. False otherwise. auto ExcludePathLogic = [&]() -> bool { for(int32 i = 0; i < ExcludePaths.Num(); ++i) { if(SourceFilePath.MatchesWildcard(ExcludePaths[i])) { return true; } } return false; }; if(ExcludePathLogic()) { continue; } GatherTextFromUObject(*It, Arguments); } }
void UGatherTextFromMetaDataCommandlet::GatherTextFromUObjects(const TArray<FString>& IncludePaths, const TArray<FString>& ExcludePaths) { for(TObjectIterator<UField> It; It; ++It) { FString SourceFilePath; FSourceCodeNavigation::FindClassHeaderPath(*It, SourceFilePath); // Returns true if in an include path. False otherwise. auto IncludePathLogic = [&]() -> bool { for(int32 i = 0; i < IncludePaths.Num(); ++i) { if(SourceFilePath.MatchesWildcard(FPaths::RootDir() + IncludePaths[i] + TEXT("*"))) { return true; } } return false; }; if(!IncludePathLogic()) { continue; } // Returns true if in an exclude path. False otherwise. auto ExcludePathLogic = [&]() -> bool { for(int32 i = 0; i < ExcludePaths.Num(); ++i) { if(SourceFilePath.MatchesWildcard(ExcludePaths[i])) { return true; } } return false; }; if(ExcludePathLogic()) { continue; } GatherTextFromUObject(*It); } }