SGL
privatediff.h
1 /*
2  * File: diff.h
3  * ------------
4  * This file contains declarations of functions that perform a text 'diff'
5  * operation to compare two strings and output the differences.
6  *
7  * @author Marty Stepp
8  * @version 2016/10/30
9  * - fixed diff flags; added punctuation flag
10  * @version 2016/10/28
11  * - added DEFAULT_STRICT_FLAGS
12  * @version 2016/10/22
13  * - added diffPass (for autograder assertDiff)
14  * @version 2014/10/14
15  * - initial version
16  * @since 2014/10/14
17  */
18 
19 
20 #ifndef _diff_h
21 #define _diff_h
22 
23 #include <string>
24 
25 namespace diff {
26 const string NO_DIFFS_MESSAGE = "No differences found";
27 
28 enum DiffFlags {
29  IGNORE_NONE = 0x0,
34  IGNORE_CASE = 0x10,
41  IGNORE_EVERYTHING = 0x100000
42 };
43 
46 
47 string diff(string s1, string s2, int flags = DIFF_DEFAULT_FLAGS);
48 bool diffPass(const string& s1, const string& s2, int flags = DIFF_DEFAULT_FLAGS);
49 bool isDiffMatch(const string& diffs);
50 } // namespace diff
51 
52 #endif // _diff_h
Definition: privatediff.h:34
Definition: privatediff.h:36
Definition: privatediff.h:30
Definition: privatediff.h:33
DiffFlags
Definition: privatediff.h:28
Definition: privatediff.h:41
const string NO_DIFFS_MESSAGE
Definition: privatediff.h:26
Definition: privatediff.h:40
Definition: privatediff.h:39
Definition: privatediff.h:37
const int DIFF_STRICT_FLAGS
Definition: privatediff.h:44
Definition: privatediff.h:35
bool diffPass(string s1, string s2, int flags)
Definition: privatediff.cpp:289
Definition: privatediff.cpp:29
Definition: privatediff.h:32
bool isDiffMatch(string diffs)
Definition: privatediff.cpp:295
const int DIFF_DEFAULT_FLAGS
Definition: privatediff.h:45
string diff(string s1, string s2, int flags)
Definition: privatediff.cpp:48
Definition: privatediff.h:38
Definition: privatediff.h:31
Definition: privatediff.h:29