cubicdaiya / dtl Goto Github PK
View Code? Open in Web Editor NEWdiff template library written by C++
License: Other
diff template library written by C++
License: Other
Steps to reproduce:
#include "3rdparty/dtl/dtl.hpp"
#include <iostream>
#include <vector>
int main(int argc, char *argv[]) {
std::vector<char> a = {'a','b','c','d'};
std::vector<char> b = {'a','b','c','d','e','f'};
std::cout << "a: " << "abcd" << "\n";
std::cout << "b: " << "abcdef" << "\n";
dtl::Diff<char,std::vector<char>> d(b,a);
d.compose();
d.onHuge();
d.composeUnifiedHunks();
d.printUnifiedFormat();
return 0;
}
Output:
a: abcd
b: abcdef
@@ -2,5 +2,3 @@
b
c
d
-e
-f
Does anyone know why the first element 'a' is not defined as common to sequences? Is there any way around this mistake without losing performance?
string s2 = d.UniPatch(s1);
case sensitive error
string s2 = d.uniPatch(s1);
start with small case needed
The latest release (v1.19) is from 2016. Even though there has been only one change to the library, I think it might be a good idea to have a new release, such as v1.20.
std::string base_code_ = "0";
std::string left_code_ = "100";
std::string right_code_ = "200";
dtl::Diff3<char, std::string> diff3(base_code_, left_code_, right_code_);
diff3.compose();
if (!diff3.merge())
{
std::cout << "Conflict" << std::endl;
}
else
{
std::string merged = diff3.getMergedSequence(); // 20 here
}
I expect conflict
I saw that when performing comparison between two large buffers, onHuge
may be called to optimise the calculation.
But how large is large? Is it when the buffers are 1kb+, 100kb+, 1mb+ or 10mb+?
Hi,
Please consider adding an option to diff by substrings.
E.g. column 4-10 of file a and b instead of the whole line.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.