[Aaru.Core] Implement showing archive information.

This commit is contained in:
2023-10-06 15:37:20 +01:00
parent 59183ebd9d
commit e6dfefcd4c
4 changed files with 71 additions and 0 deletions

56
Aaru.Core/ArchiveInfo.cs Normal file
View 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();
}
}

View File

@@ -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>
/// Looks up a localized string similar to ASCII implemented operating definitions: {0}.
/// </summary>

View File

@@ -3475,4 +3475,7 @@ No tiene sentido hacerlo y supondría demasiado esfuerzo para la cinta.</value>
<data name="_GENERATED" xml:space="preserve">
<value> (GENERADO)</value>
</data>
<data name="Archive_Information_With_Markup" xml:space="preserve">
<value>[bold]Información del archivo[/]</value>
</data>
</root>

View File

@@ -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">
<value>This image contains low-level flux captures.</value>
</data>
<data name="Archive_Information_With_Markup" xml:space="preserve">
<value>[bold]Archive information:[/]</value>
</data>
</root>