Created
October 18, 2022 16:12
-
-
Save Buckminsterfullerene02/90d1d02a6639f656e284bd799801241c to your computer and use it in GitHub Desktop.
Written by dedede123
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$RootPath = "D:\DEV\TresGame\Source\TresGame" | |
$Confirm = $False # Confirm each step? | |
# *.h | |
Get-ChildItem -Path $RootPath -Filter *.h -Recurse | ForEach-Object { | |
$PathToFile = $_.FullName | |
$ClassName = $_.BaseName | |
$FileContent = Get-Content -Path $PathToFile | |
if ($FileContent -match "class .*A$ClassName : public"){ | |
# is actor | |
#$PathToFile | |
$ClassName | |
if ($Confirm){ | |
Write-Host "Continue replace?" | |
pause | |
} | |
$FileContent -replace [System.Text.RegularExpressions.Regex]::Escape("A$ClassName();"), "A$ClassName(const FObjectInitializer& ObjectInitializer);" | Set-Content -Path $PathToFile | |
#Write-Host "" | |
} | |
} | |
# *.cpp | |
Get-ChildItem -Path $RootPath -Filter *.cpp -Recurse | ForEach-Object { | |
$PathToFile = $_.FullName | |
$ClassName = $_.BaseName | |
$FileContent = Get-Content -Path $PathToFile | |
if ($FileContent -match [System.Text.RegularExpressions.Regex]::Escape("A$ClassName::A$ClassName() {")){ | |
# is actor | |
#$PathToFile | |
$ClassName | |
if ($Confirm){ | |
Write-Host "Continue replace?" | |
pause | |
} | |
$FileContent -replace [System.Text.RegularExpressions.Regex]::Escape("A$ClassName::A$ClassName() {"), "A$ClassName::A$ClassName(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) {" | Set-Content -Path $PathToFile | |
#Write-Host "" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment