OTest2
A C++ testing framework
difflogreverse.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Ondrej Starek
3  *
4  * This file is part of OTest2.
5  *
6  * OTest2 is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License,
9  * or (at your option) any later version.
10  *
11  * OTest2 is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with OTest2. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #include <difflogreverse.h>
20 
21 #include <assert.h>
22 
23 namespace OTest2 {
24 
26  DiffLogBuilder* next_) :
27  next(next_) {
28  assert(next != nullptr);
29 
30 }
31 
33 
34 }
35 
37  int left_index_,
38  int right_index_) {
39  next->addMatch(right_index_, left_index_);
40 }
41 
43  int left_index_,
44  int right_index_) {
45  next->addChange(right_index_, left_index_);
46 }
47 
49  int right_index_) {
50  next->addInsert(right_index_);
51 }
52 
54  int left_index_) {
55  next->addDelete(left_index_);
56 }
57 
58 } /* namespace OTest2 */
OTest2::DiffLogBuilderReverse::addMatch
virtual void addMatch(int left_index_, int right_index_)
Add match of characters in both sequences.
Definition: difflogreverse.cpp:36
OTest2::DiffLogBuilder::addMatch
virtual void addMatch(int left_index_, int right_index_)=0
Add match of characters in both sequences.
OTest2::DiffLogBuilderReverse::addDelete
virtual void addDelete(int right_index_)
Add deleted item from the right sequence.
Definition: difflogreverse.cpp:48
OTest2::DiffLogBuilderReverse::addChange
virtual void addChange(int left_index_, int right_index_)
Add change of both sequences.
Definition: difflogreverse.cpp:42
OTest2::DiffLogBuilder
Generic interface of the log builder.
Definition: difflogbuilder.h:30
OTest2::DiffLogBuilderReverse::DiffLogBuilderReverse
DiffLogBuilderReverse(DiffLogBuilder *next_)
Ctor.
Definition: difflogreverse.cpp:25
OTest2::DiffLogBuilderReverse::addInsert
virtual void addInsert(int left_index_)
Add inserted item to the left sequence.
Definition: difflogreverse.cpp:53
OTest2
Definition: assertbean.h:25
OTest2::DiffLogBuilderReverse::~DiffLogBuilderReverse
virtual ~DiffLogBuilderReverse()
Dtor.
Definition: difflogreverse.cpp:32
OTest2::DiffLogBuilder::addChange
virtual void addChange(int left_index_, int right_index_)=0
Add change of both sequences.
difflogreverse.h
OTest2::DiffLogBuilder::addInsert
virtual void addInsert(int left_index_)=0
Add inserted item to the left sequence.
OTest2::DiffLogBuilder::addDelete
virtual void addDelete(int right_index_)=0
Add deleted item from the right sequence.