Arkanjo 0.1
A tool for find code duplicated functions in codebases
Loading...
Searching...
No Matches
parser.hpp
Go to the documentation of this file.
1
12
13#ifndef PARSER_HPP
14#define PARSER_HPP
15
16#include <bits/stdc++.h>
17using namespace std;
18
26 string path1;
27 string path2;
28 double similarity;
29
34
41 Comparation(string _path1, string _path2, double _sim);
42
48 bool operator<(const Comparation &com) const;
49
55 bool operator==(const Comparation &com) const;
56};
57
64class Parser {
65 private:
66 string PROJECT_PATH_MESSAGE = "Enter your project path:";
67 string MINIMUM_SIMILARITY_MESSAGE = "Enter minimum similarity desired on using the tool:";
68
69 ifstream fin;
70 ofstream fout;
71 double similarity_cap_;
72
78 vector<string> parser_line(string line);
79
85 bool is_an_file(string s);
86
92 string remove_formatation_from_similarity(string s);
93
99 double retrive_similarity(string s);
100
106 void parser_block(string path, set<Comparation> &comparations);
107
111 void exec();
112
113 public:
120 Parser(string input_file, string output_file, double similarity_cap);
121};
122
123#endif
Parser(string input_file, string output_file, double similarity_cap)
Constructs parser with configuration.
Definition parser.cpp:112
Structure representing a code comparison result.
Definition parser.hpp:25
bool operator<(const Comparation &com) const
Comparison operator for sorting.
Definition parser.cpp:11
double similarity
Similarity score between the files (0-100)
Definition parser.hpp:28
Comparation()
Default constructor.
Definition parser.hpp:33
string path1
Path to first code file being compared.
Definition parser.hpp:26
bool operator==(const Comparation &com) const
Equality comparison operator.
Definition parser.cpp:21
string path2
Path to second code file being compared.
Definition parser.hpp:27