-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from EonZeNx/feature/update-03
Feature/update 03
- Loading branch information
Showing
76 changed files
with
2,270 additions
and
349 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\ApexChains\ApexChain.AAFSARC\ApexChain.AAFSARC.csproj" /> | ||
<ProjectReference Include="..\ApexFormats\ApexFormat.AAF.V01\ApexFormat.AAF.V01.csproj" /> | ||
<ProjectReference Include="..\ApexFormats\ApexFormat.ADF.V04\ApexFormat.ADF.V04.csproj" /> | ||
<ProjectReference Include="..\ApexFormats\ApexFormat.AVTX.V01\ApexFormat.AVTX.V01.csproj" /> | ||
<ProjectReference Include="..\ApexFormats\ApexFormat.IRTPC.V14\ApexFormat.IRTPC.V14.csproj" /> | ||
<ProjectReference Include="..\ApexFormats\ApexFormat.RTPC.V01\ApexFormat.RTPC.V01.csproj" /> | ||
<ProjectReference Include="..\ApexFormats\ApexFormat.RTPC.V03\ApexFormat.RTPC.V03.csproj" /> | ||
<ProjectReference Include="..\ApexFormats\ApexFormat.SARC.V02\ApexFormat.SARC.V02.csproj" /> | ||
<ProjectReference Include="..\ApexFormats\ApexFormat.TAB.V02\ApexFormat.TAB.V02.csproj" /> | ||
<ProjectReference Include="..\ATL.Core\ATL.Core.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
using ApexChain.AAFSARC; | ||
using ApexFormat.AAF.V01; | ||
using ApexFormat.ADF.V04; | ||
using ApexFormat.AVTX.V01; | ||
using ApexFormat.IRTPC.V14; | ||
using ApexFormat.RTPC.V01; | ||
using ApexFormat.RTPC.V03; | ||
using ApexFormat.SARC.V02; | ||
using ApexFormat.TAB.V02; | ||
using ATL.Core.Class; | ||
using ATL.Core.Libraries; | ||
|
||
namespace ATL.Console; | ||
|
||
public static class AtlOperate | ||
{ | ||
public static void OperateFile(string inPath, string outDirectory) | ||
{ | ||
var pathName = Path.GetFileName(inPath); | ||
if (string.IsNullOrEmpty(pathName)) | ||
pathName = Path.GetDirectoryName(inPath); | ||
|
||
var message = $"Processing '{pathName}'"; | ||
|
||
IProcessBasic manager; | ||
if (TabV02Manager.CanProcess(inPath)) | ||
{ | ||
manager = new TabV02Manager(); | ||
message = $"{message} as TABv02"; | ||
} | ||
else if (AafV01SarcV02Manager.CanProcess(inPath)) | ||
{ | ||
manager = new AafV01SarcV02Manager(); | ||
message = $"{message} as AAFv01-SARCv02 chain"; | ||
} | ||
else if (SarcV02Manager.CanProcess(inPath)) | ||
{ | ||
manager = new SarcV02Manager(); | ||
message = $"{message} as SARCv02"; | ||
} | ||
else if (AafV01Manager.CanProcess(inPath)) | ||
{ | ||
manager = new AafV01Manager(); | ||
message = $"{message} as AAFv01"; | ||
} | ||
else if (AdfV04Manager.CanProcess(inPath)) | ||
{ | ||
manager = new AdfV04Manager(); | ||
message = $"{message} as ADFv04"; | ||
} | ||
else if (AvtxV01Manager.CanProcess(inPath)) | ||
{ | ||
manager = new AvtxV01Manager(); | ||
message = $"{message} as AVTXv01"; | ||
} | ||
else if (RtpcV01Manager.CanProcess(inPath)) | ||
{ | ||
manager = new RtpcV01Manager(); | ||
message = $"{message} as RTPCv01"; | ||
} | ||
else if (RtpcV03Manager.CanProcess(inPath)) | ||
{ | ||
manager = new RtpcV03Manager(); | ||
message = $"{message} as RTPCv03"; | ||
} | ||
else if (IrtpcV14Manager.CanProcess(inPath)) | ||
{ // should be last | ||
manager = new IrtpcV14Manager(); | ||
message = $"{message} as RTPCv0104"; | ||
} | ||
// Scripts should not be run from here | ||
// else if (Path.GetExtension(inPath) == ".xml") | ||
else | ||
{ | ||
ConsoleLibrary.Log($"File not supported '{pathName}'", LogType.Warning); | ||
return; | ||
} | ||
|
||
ConsoleLibrary.Log(message, LogType.Info); | ||
|
||
var absoluteOutDirectory = GetAbsoluteDirectory(inPath, outDirectory); | ||
manager.ProcessBasic(inPath, absoluteOutDirectory); | ||
|
||
ConsoleLibrary.Log($"Finished '{pathName}'", LogType.Info); | ||
} | ||
|
||
public static string GetAbsoluteDirectory(string inPath, string outDirectory) | ||
{ | ||
var result = Path.GetDirectoryName(inPath) ?? inPath; | ||
|
||
if (!string.IsNullOrEmpty(outDirectory)) | ||
{ // outDirectory is valid | ||
result = Path.IsPathFullyQualified(outDirectory) | ||
? outDirectory | ||
: Path.GetFullPath(outDirectory, AppDomain.CurrentDomain.BaseDirectory); | ||
} | ||
|
||
return result; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
namespace ATL.Core.Extensions; | ||
|
||
public static class IOLibrary | ||
{ | ||
public static void CopyDirectory(string sourceDir, string destinationDir, bool recursive = true) | ||
{ | ||
// Get information about the source directory | ||
var dir = new DirectoryInfo(sourceDir); | ||
|
||
// Check if the source directory exists | ||
if (!dir.Exists) | ||
throw new DirectoryNotFoundException($"Source directory not found: {dir.FullName}"); | ||
|
||
// Cache directories before we start copying | ||
var dirs = dir.GetDirectories(); | ||
|
||
// Create the destination directory | ||
Directory.CreateDirectory(destinationDir); | ||
|
||
// Get the files in the source directory and copy to the destination directory | ||
foreach (var file in dir.GetFiles()) | ||
{ | ||
var targetFilePath = Path.Combine(destinationDir, file.Name); | ||
file.CopyTo(targetFilePath); | ||
} | ||
|
||
// If recursive and copying subdirectories, recursively call this method | ||
if (!recursive) | ||
return; | ||
|
||
foreach (var subDir in dirs) | ||
{ | ||
var newDestinationDir = Path.Combine(destinationDir, subDir.Name); | ||
CopyDirectory(subDir.FullName, newDestinationDir, true); | ||
} | ||
} | ||
} |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\ATL.Console\ATL.Console.csproj" /> | ||
<ProjectReference Include="..\ATL.Core\ATL.Core.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.