using System;
using System.IO;

namespace ReportGeneration.Interface;

public interface IStreamWriter : IDisposable
{
  /// <inheritdoc cref="TextWriter.WriteLine(string)"/>
  IStreamWriter Write(string? text = default);

  /// <inheritdoc cref="TextWriter.WriteLine(string)"/>
  IStreamWriter WriteLine(string? text = default);

  /// <summary>
  /// <para>Writes the contents of the given <paramref name="writer"/>
  /// to the internal <see cref="Stream"/></para>
  /// </summary>
  IStreamWriter Write(IStreamWriter writer);

  /// <summary>
  /// <para>Writes the contents of the given <paramref name="reader"/>
  /// to the internal <see cref="Stream"/></para>
  /// </summary>
  IStreamWriter Write(StreamReader reader);

  /// <summary>
  /// Finalizes the content writer
  /// </summary>
  void Close();

  /// <summary>
  /// Initializes the content writer
  /// </summary>
  void Open();

  /// <summary>
  /// Reads the content of the underlying stream
  /// </summary>
  StreamReader Read();
}
