36 lines
1.2 KiB
C#
36 lines
1.2 KiB
C#
namespace MeetTheTeacher.Export;
|
|
|
|
/// <summary>
|
|
/// Base class for exporters which write data to a file
|
|
/// </summary>
|
|
public abstract class FileExporterBase
|
|
{
|
|
/// <summary>
|
|
/// File extension of the exported file including the dot
|
|
/// </summary>
|
|
protected abstract string FileExtension { get; }
|
|
|
|
/// <summary>
|
|
/// Exports the given content to a file with the given name.
|
|
/// If the file already exists, it will be overwritten.
|
|
/// </summary>
|
|
/// <param name="fileName">Name of the file to export without the extension</param>
|
|
/// <param name="content">Content to write into the file</param>
|
|
protected void Export(string fileName, string content)
|
|
{
|
|
// TODO (don't forget to delete)
|
|
}
|
|
|
|
/// <summary>
|
|
/// Joins several lines into one text, separated by line breaks
|
|
/// </summary>
|
|
/// <param name="lines">Lines to merge</param>
|
|
/// <returns>A text containing all lines</returns>
|
|
protected static string LinesToText(IEnumerable<string> lines) => null!; // TODO (remember to use proper line break)
|
|
|
|
private string GetFilePath(string fileName)
|
|
{
|
|
// TODO (remember to use the current directory)
|
|
return null!;
|
|
}
|
|
}
|