OSDN Git Service

Fix an issue where items with different case are not displayed correctly in the folde...
[winmerge-jp/winmerge-jp.git] / Src / stringdiffs.h
1 /** 
2  * @file  stringdiffs.h
3  *
4  * @brief Interface file declaring ComputeWordDiffs (q.v.)
5  *
6  */
7 #pragma once
8
9 #include "UnicodeString.h"
10 #include <vector>
11
12 namespace strdiff
13 {
14
15 /** @brief One difference between two strings */
16 struct wdiff {
17         std::array<int, 3> begin; // 0-based, eg, begin[0] is from str1
18         std::array<int, 3> end; // 0-based, eg, end[1] is from str2
19         int op;
20         wdiff(int s1=0, int e1=0, int s2=0, int e2=0, int s3=0, int e3=0)
21                 : begin{s1, s2, s3}
22                 , op(-1)
23         {
24                 if (s1>e1) e1=s1-1;
25                 if (s2>e2) e2=s2-1;
26                 if (s3>e3) e3=s3-1;
27                 end[0] = e1;
28                 end[1] = e2;
29                 end[2] = e3;
30         }
31 };
32
33 void Init();
34 void Close();
35
36 void SetBreakChars(const TCHAR *breakChars);
37
38 std::vector<wdiff> ComputeWordDiffs(const String& str1, const String& str2,
39         bool case_sensitive, bool eol_sensitive, int whitespace, bool ignore_numbers, int breakType, bool byte_level);
40 std::vector<wdiff> ComputeWordDiffs(int nStrings, const String *str, 
41                    bool case_sensitive, bool eol_sensitive, int whitespace, bool ignore_numbers, int breakType, bool byte_level);
42 int Compare(const String& str1, const String& str2,
43         bool case_sensitive, bool eol_sensitive, int whitespace, bool ignore_numbers);
44
45 }