OTest2
A C++ testing framework
|
Go to the documentation of this file.
20 #ifndef OTest2__LIB_DIFFLOGARRAY_H_
21 #define OTest2__LIB_DIFFLOGARRAY_H_
99 template<
typename Type_,
typename ScoreFce_ = DiffScoreLCS<Type_> >
102 std::size_t left_len_,
103 const Type_ right_[],
104 std::size_t right_len_,
106 ScoreFce_ score_fce_ = ScoreFce_()) {
109 diff_.reserve((left_len_ + right_len_) / 8);
113 hirschbergDiff(left_, left_len_, right_, right_len_, builder_, score_fce_);
116 diff_log_.swap(diff_);
virtual void addDelete(int right_index_)
Add deleted item from the right sequence.
void hirschbergDiff(const Type_ left_[], std::size_t left_len_, const Type_ right_[], std::size_t right_len_, DiffLogArray &diff_log_, ScoreFce_ score_fce_=ScoreFce_())
Compute the diff algorithm for specified sequences.
Generic interface of the log builder.
virtual void addInsert(int left_index_)
Add inserted item to the left sequence.
virtual void addChange(int left_index_, int right_index_)
Add change of both sequences.
std::vector< DiffRecord > DiffLogArray
Ordered (indexes into the sequences) list of diff changes.
virtual void addMatch(int left_index_, int right_index_)
Add match of characters in both sequences.
DiffLogBuilderArray(DiffLogArray *array_)
Ctor.
Builder of the diff array.
DiffLogBuilderArray & operator=(const DiffLogBuilderArray &)=delete
virtual ~DiffLogBuilderArray()
Dtor.