mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Aaru.Core] Implement showing archive information.
This commit is contained in:
56
Aaru.Core/ArchiveInfo.cs
Normal file
56
Aaru.Core/ArchiveInfo.cs
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
// /***************************************************************************
|
||||||
|
// Aaru Data Preservation Suite
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Filename : ArchiveInfo.cs
|
||||||
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||||
|
//
|
||||||
|
// Component : Core algorithms.
|
||||||
|
//
|
||||||
|
// --[ Description ] ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Prints image information to console.
|
||||||
|
//
|
||||||
|
// --[ License ] --------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
|
// License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Copyright © 2011-2023 Natalia Portillo
|
||||||
|
// ****************************************************************************/
|
||||||
|
|
||||||
|
using System.Text;
|
||||||
|
using Aaru.CommonTypes.Interfaces;
|
||||||
|
using Aaru.Console;
|
||||||
|
|
||||||
|
namespace Aaru.Core;
|
||||||
|
|
||||||
|
/// <summary>Image information operations</summary>
|
||||||
|
public static class ArchiveInfo
|
||||||
|
{
|
||||||
|
const string MODULE_NAME = "Archive information";
|
||||||
|
|
||||||
|
/// <summary>Prints archive information to console</summary>
|
||||||
|
/// <param name="imageFormat">Archive</param>
|
||||||
|
public static void PrintArchiveInfo(IArchive imageFormat, IFilter filter, Encoding encoding)
|
||||||
|
{
|
||||||
|
AaruConsole.WriteLine(Localization.Core.Archive_Information_With_Markup);
|
||||||
|
|
||||||
|
imageFormat.GetInformation(filter, encoding, out string information);
|
||||||
|
|
||||||
|
AaruConsole.WriteLine(information);
|
||||||
|
|
||||||
|
AaruConsole.WriteLine();
|
||||||
|
}
|
||||||
|
}
|
||||||
9
Aaru.Localization/Core.Designer.cs
generated
9
Aaru.Localization/Core.Designer.cs
generated
@@ -347,6 +347,15 @@ namespace Aaru.Localization {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to [bold]Archive information:[/].
|
||||||
|
/// </summary>
|
||||||
|
public static string Archive_Information_With_Markup {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Archive_Information_With_Markup", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to ASCII implemented operating definitions: {0}.
|
/// Looks up a localized string similar to ASCII implemented operating definitions: {0}.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -3475,4 +3475,7 @@ No tiene sentido hacerlo y supondría demasiado esfuerzo para la cinta.</value>
|
|||||||
<data name="_GENERATED" xml:space="preserve">
|
<data name="_GENERATED" xml:space="preserve">
|
||||||
<value> (GENERADO)</value>
|
<value> (GENERADO)</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Archive_Information_With_Markup" xml:space="preserve">
|
||||||
|
<value>[bold]Información del archivo[/]</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -3493,4 +3493,7 @@ It has no sense to do it, and it will put too much strain on the tape.</value>
|
|||||||
<data name="Image_flux_captures" xml:space="preserve">
|
<data name="Image_flux_captures" xml:space="preserve">
|
||||||
<value>This image contains low-level flux captures.</value>
|
<value>This image contains low-level flux captures.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Archive_Information_With_Markup" xml:space="preserve">
|
||||||
|
<value>[bold]Archive information:[/]</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
Reference in New Issue
Block a user