File indexing completed on 2024-04-21 05:44:11
0001 /* 0002 SPDX-FileCopyrightText: 2011 Dmitry Risenberg <dmitry.risenberg@gmail.com> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef KOMPAREDIFF2_STRINGLISTPAIR_H 0008 #define KOMPAREDIFF2_STRINGLISTPAIR_H 0009 0010 // lib 0011 #include "marker.h" 0012 // Qt 0013 #include <QStringList> 0014 // Std 0015 #include <vector> 0016 0017 namespace KompareDiff2 0018 { 0019 0020 class StringListPair 0021 { 0022 public: 0023 StringListPair(const QStringList &first, const QStringList &second); 0024 ~StringListPair(); 0025 bool equal(unsigned int firstIndex, unsigned int secondIndex) const; 0026 unsigned int lengthFirst() const; 0027 unsigned int lengthSecond() const; 0028 MarkerList markerListFirst() const; 0029 MarkerList markerListSecond() const; 0030 void prependFirst(Marker *marker); 0031 void prependSecond(Marker *marker); 0032 bool needFineGrainedOutput(unsigned int difference) const; 0033 0034 const static bool allowReplace = false; 0035 0036 private: 0037 const QStringList m_first; 0038 const QStringList m_second; 0039 const unsigned int m_lengthFirst; 0040 const unsigned int m_lengthSecond; 0041 std::vector<unsigned int> m_hashesFirst; 0042 std::vector<unsigned int> m_hashesSecond; 0043 MarkerList m_markersFirst; 0044 MarkerList m_markersSecond; 0045 }; 0046 0047 } 0048 0049 #endif // KOMPAREDIFF2_STRINGLISTPAIR_H