forked from dlidstrom/Duplo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Duplo.h
executable file
·69 lines (59 loc) · 2.21 KB
/
Duplo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/** \class Duplo
* Duplo, main class
*
* @author Christian Ammann (cammann@giants.ch)
* @date 16/05/05
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _DUPLO_H_
#define _DUPLO_H_
#include <iostream>
#include <memory>
#include <string>
#include <vector>
class SourceFile;
class IOutGenerator;
const std::string VERSION = "0.2.0";
class Duplo {
protected:
std::string m_listFileName;
unsigned int m_minBlockSize;
unsigned int m_blockPercentThreshold;
unsigned int m_minChars;
bool m_ignorePrepStuff;
bool m_ignoreSameFilename;
int m_maxLinesPerFile;
int m_DuplicateLines;
bool m_Xml;
//std::unique_ptr< unsigned char [ ] > m_pMatrix;
std::vector<bool> m_pMatrix;
std::unique_ptr< IOutGenerator> _report_generator;
long matrix_size = 0;
void reportSeq(int line1, int line2, int count, const SourceFile& pSource1, const SourceFile& pSource2, std::ostream& outFile);
int process( const SourceFile& pSource1, const SourceFile& pSource2, std::ostream& outFile);
const std::string getFilenamePart(const std::string& fullpath) const;
bool isSameFilename(const std::string& filename1, const std::string& filename2) const;
public:
Duplo(
const std::string& listFileName,
unsigned int blockPercentThreshold,
unsigned int minBlockSize,
unsigned int minChars,
bool ignorePrepStuff, bool ignoreSameFilename, bool Xml);
~Duplo();
void run(std::string outputFileName);
};
#endif