Pulp
1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
text_diff.hpp
Go to the documentation of this file.
1
#pragma once
2
3
// Simple text diff using LCS (Longest Common Subsequence)
4
5
#include <string>
6
#include <string_view>
7
#include <vector>
8
9
namespace
pulp::runtime
{
10
11
enum class
DiffOp
{
Equal
,
Insert
,
Delete
};
12
13
struct
DiffEntry
{
14
DiffOp
op
;
15
std::string
text
;
16
};
17
20
std::vector<DiffEntry>
text_diff
(std::string_view from, std::string_view to);
21
23
std::string
format_diff
(
const
std::vector<DiffEntry>& diff);
24
25
}
// namespace pulp::runtime
pulp::runtime
Definition
generated_event_source.hpp:33
pulp::runtime::DiffOp
DiffOp
Definition
text_diff.hpp:11
pulp::runtime::DiffOp::Insert
@ Insert
Definition
text_diff.hpp:11
pulp::runtime::DiffOp::Delete
@ Delete
Definition
text_diff.hpp:11
pulp::runtime::DiffOp::Equal
@ Equal
Definition
text_diff.hpp:11
pulp::runtime::text_diff
std::vector< DiffEntry > text_diff(std::string_view from, std::string_view to)
Compute a line-based diff between two strings.
pulp::runtime::format_diff
std::string format_diff(const std::vector< DiffEntry > &diff)
Format a diff as a unified diff string (with +/- prefixes).
pulp::runtime::DiffEntry
Definition
text_diff.hpp:13
pulp::runtime::DiffEntry::text
std::string text
Definition
text_diff.hpp:15
pulp::runtime::DiffEntry::op
DiffOp op
Definition
text_diff.hpp:14
core
runtime
include
pulp
runtime
text_diff.hpp
Generated by
1.15.0