diff --git a/Aaru.Core/ArchiveInfo.cs b/Aaru.Core/ArchiveInfo.cs new file mode 100644 index 000000000..fe0111e6d --- /dev/null +++ b/Aaru.Core/ArchiveInfo.cs @@ -0,0 +1,56 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ArchiveInfo.cs +// Author(s) : Natalia Portillo +// +// 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 . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2023 Natalia Portillo +// ****************************************************************************/ + +using System.Text; +using Aaru.CommonTypes.Interfaces; +using Aaru.Console; + +namespace Aaru.Core; + +/// Image information operations +public static class ArchiveInfo +{ + const string MODULE_NAME = "Archive information"; + + /// Prints archive information to console + /// Archive + 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(); + } +} \ No newline at end of file diff --git a/Aaru.Localization/Core.Designer.cs b/Aaru.Localization/Core.Designer.cs index bb7081b35..5485e65e7 100644 --- a/Aaru.Localization/Core.Designer.cs +++ b/Aaru.Localization/Core.Designer.cs @@ -347,6 +347,15 @@ namespace Aaru.Localization { } } + /// + /// Looks up a localized string similar to [bold]Archive information:[/]. + /// + public static string Archive_Information_With_Markup { + get { + return ResourceManager.GetString("Archive_Information_With_Markup", resourceCulture); + } + } + /// /// Looks up a localized string similar to ASCII implemented operating definitions: {0}. /// diff --git a/Aaru.Localization/Core.es.resx b/Aaru.Localization/Core.es.resx index 1cc5821f9..f665508a4 100644 --- a/Aaru.Localization/Core.es.resx +++ b/Aaru.Localization/Core.es.resx @@ -3475,4 +3475,7 @@ No tiene sentido hacerlo y supondría demasiado esfuerzo para la cinta. (GENERADO) + + [bold]Información del archivo[/] + \ No newline at end of file diff --git a/Aaru.Localization/Core.resx b/Aaru.Localization/Core.resx index 91f695e2a..90827f1d0 100644 --- a/Aaru.Localization/Core.resx +++ b/Aaru.Localization/Core.resx @@ -3493,4 +3493,7 @@ It has no sense to do it, and it will put too much strain on the tape. This image contains low-level flux captures. + + [bold]Archive information:[/] + \ No newline at end of file