OSDN Git Service

Fix issue #784: Error on try to show differences between two different gif
[winmerge-jp/winmerge-jp.git] / Src / MovedLines.h
1 /** 
2  * @file  MovedLines.h
3  *
4  * @brief Declaration of MovedLines class
5  */
6 #pragma once
7
8 #include <map>
9
10 /**
11  * @brief Container class for moved lines/blocks.
12  * This class contains list of moved blocs/lines we detect
13  * when comparing files.
14  */
15 class MovedLines
16 {
17 public:
18         /** @brief Sides for mapping functions. */
19         enum class SIDE
20         {
21                 LEFT,
22                 RIGHT,
23         };
24
25         void Clear();
26         void Add(SIDE side1, unsigned line1, unsigned line2);
27         int LineInBlock(unsigned line, SIDE side) const;
28
29 protected:
30         int FirstSideInMovedBlock(unsigned secondSideLine) const;
31         int SecondSideInMovedBlock(unsigned firstSideLine) const;
32
33 private:
34         typedef std::map<int, int> MovedLinesMap;
35         MovedLinesMap m_moved0; /**< Moved lines map for first side */
36         MovedLinesMap m_moved1; /**< Moved lines map for second side */
37 };