dtl/examples/strdiff_cp.cpp
Wiktor Lawski afddfbccf6 Make custom change printer example more mature
printers.hpp does not depend anymore on includes or usings order
inside strdiff_cp.cpp file.
2020-09-12 16:47:17 +02:00

36 lines
611 B
C++

#include <dtl/dtl.hpp>
#include "common.hpp"
#include <iostream>
#include <sstream>
#include <string>
#include "printers.hpp"
using namespace std;
using dtl::Diff;
int main(int argc, char *argv[]){
if (isFewArgs(argc)) {
cerr << "Too few arguments." << endl;
return -1;
}
typedef char elem;
typedef string sequence;
sequence A(argv[1]);
sequence B(argv[2]);
Diff< elem, sequence > d(A, B);
d.compose();
// Shortest Edit Script
cout << "SES" << endl;
d.printSES < ostream, customChangePrinter > (cout);
return 0;
}