2020-09-12 17:38:55 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
|
2023-07-15 10:33:22 +00:00
|
|
|
* Copyright (c) 2023, Shannon Booth <shannon@serenityos.org>
|
2020-09-12 17:38:55 +00:00
|
|
|
*
|
2021-04-22 08:24:48 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-09-12 17:38:55 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-06-21 06:48:17 +00:00
|
|
|
#include <AK/Error.h>
|
|
|
|
#include <AK/Forward.h>
|
2023-07-06 08:41:32 +00:00
|
|
|
#include <LibDiff/Forward.h>
|
2020-09-12 17:38:55 +00:00
|
|
|
|
|
|
|
namespace Diff {
|
2023-06-21 06:48:17 +00:00
|
|
|
|
2023-12-16 14:19:34 +00:00
|
|
|
ByteString generate_only_additions(StringView);
|
2023-06-21 06:48:17 +00:00
|
|
|
|
|
|
|
enum class ColorOutput {
|
|
|
|
Yes,
|
|
|
|
No,
|
2020-09-12 17:38:55 +00:00
|
|
|
};
|
2023-06-21 06:48:17 +00:00
|
|
|
|
2023-06-27 08:55:50 +00:00
|
|
|
ErrorOr<void> write_unified(Hunk const& hunk, Stream& stream, ColorOutput color_output = ColorOutput::No);
|
2023-06-27 08:59:01 +00:00
|
|
|
ErrorOr<void> write_unified_header(StringView old_path, StringView new_path, Stream& stream);
|
|
|
|
|
2023-06-21 06:48:17 +00:00
|
|
|
ErrorOr<void> write_normal(Hunk const& hunk, Stream& stream, ColorOutput color_output = ColorOutput::No);
|
|
|
|
|
2023-07-03 05:16:16 +00:00
|
|
|
ErrorOr<void> write_context(Hunk const& hunk, Stream& stream, ColorOutput color_output = ColorOutput::No);
|
2023-07-03 06:07:45 +00:00
|
|
|
ErrorOr<void> write_context_header(StringView old_path, StringView new_path, Stream& stream);
|
2023-06-21 06:48:17 +00:00
|
|
|
}
|