ex-int-02-meet-the-teacher/MeetTheTeacher/Export/HtmlDataExporter.cs
github-classroom[bot] 1be1863b20
Initial commit
2025-04-24 07:02:41 +00:00

27 lines
880 B
C#

using MeetTheTeacher.Model;
namespace MeetTheTeacher.Export;
/// <summary>
/// Allows to export data of <see cref="ICsvRepresentable"/> type to a file in HTML table syntax.
/// Be careful: does not create valid HTML page, just a fragment!
/// </summary>
/// <inheritdoc cref="FileExporterBase" />
/// <inheritdoc cref="IDataExporter" />
public sealed class HtmlDataExporter : FileExporterBase, IDataExporter
{
public void Export(IEnumerable<ICsvRepresentable> items, string? fileName)
{
// TODO (use a raw string literal with interpolation!)
}
private static string CreateTableRow(IEnumerable<string> values, bool isHeader = false)
{
// TODO
return null!;
}
private static string WrapInTag(string content, string tag) => $"<{tag}>{content}</{tag}>";
protected override string FileExtension => ".html";
}