Possible duplicate:
Is there a way to separate files from C ++?
I have long text lines that I want to split and plan. These are lines a and b:
string a = ...; string b = ...; string a_diff_b = create_patch(a,b); string a2 = apply_patch(a_diff_b, b); assert(a == a2);
If a_diff_b was a person to read, that would be a bonus.
One way to implement this is to use system(3) to invoke the diff and patch shell commands from diffutils and pass them to the lines. Another way would be to implement the functions on my own (I thought of each line atomically and used the standard editing distance n ^ 3 of the algorithm with reverse tracing).
I was wondering if anyone knows of a good Linux C or C ++ library that will do the job in the process?
c ++ c algorithm linux diff
Andrew Tomazos
source share