Format.h 885 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
  3. * Copyright (c) 2023, Shannon Booth <shannon@serenityos.org>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <AK/Error.h>
  9. #include <AK/Forward.h>
  10. #include <LibDiff/Forward.h>
  11. namespace Diff {
  12. ByteString generate_only_additions(StringView);
  13. enum class ColorOutput {
  14. Yes,
  15. No,
  16. };
  17. ErrorOr<void> write_unified(Hunk const& hunk, Stream& stream, ColorOutput color_output = ColorOutput::No);
  18. ErrorOr<void> write_unified_header(StringView old_path, StringView new_path, Stream& stream);
  19. ErrorOr<void> write_normal(Hunk const& hunk, Stream& stream, ColorOutput color_output = ColorOutput::No);
  20. ErrorOr<void> write_context(Hunk const& hunk, Stream& stream, ColorOutput color_output = ColorOutput::No);
  21. ErrorOr<void> write_context_header(StringView old_path, StringView new_path, Stream& stream);
  22. }