OTest2
A C++ testing framework
difflogreverse.h
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 #ifndef OTest2__LIB_DIFFLOGREVERSE_H_
20 #define OTest2__LIB_DIFFLOGREVERSE_H_
21 
22 #include <otest2/difflogbuilder.h>
23 
24 namespace OTest2 {
25 
30  private:
31  DiffLogBuilder* next;
32 
33  public:
39  explicit DiffLogBuilderReverse(
40  DiffLogBuilder* next_);
41 
45  virtual ~DiffLogBuilderReverse();
46 
47  /* -- avoid copying */
49  const DiffLogBuilderReverse&) = delete;
51  const DiffLogBuilderReverse&) = delete;
52 
53  /* -- interface of the diff log builder */
54  virtual void addMatch(
55  int left_index_,
56  int right_index_);
57  virtual void addChange(
58  int left_index_,
59  int right_index_);
60  virtual void addDelete(
61  int right_index_);
62  virtual void addInsert(
63  int left_index_);
64 };
65 
66 } /* namespace OTest2 */
67 
68 #endif /* OTest2__LIB_DIFFLOGREVERSE_H_ */
OTest2::DiffLogBuilderReverse::addMatch
virtual void addMatch(int left_index_, int right_index_)
Add match of characters in both sequences.
Definition: difflogreverse.cpp:36
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::DiffLogBuilderReverse
Simple decorator - inversion of operations.
Definition: difflogreverse.h:29
difflogbuilder.h
OTest2::DiffLogBuilderReverse::operator=
DiffLogBuilderReverse & operator=(const DiffLogBuilderReverse &)=delete