Arkanjo 0.1
A tool for find code duplicated functions in codebases
Loading...
Searching...
No Matches
function_breaker_c.hpp
Go to the documentation of this file.
1
10
11#ifndef FUNCTION_BREAKER_C_HPP
12#define FUNCTION_BREAKER_C_HPP
13
14#include <bits/stdc++.h>
15#include "../base/utils.hpp"
17
26 const int NUMBER_OF_LINES_BEFORE_FOR_FUNCTION_NAME = 7;
27 const int C_RELEVANT_DEPTH = 0;
28 const bool IGNORE_EMPTY_FUNCTIONS = true;
29 const bool ALLOW_STRUCTS = false;
30
31 vector<string> file_content;
32 vector<vector<bool>> mask_valid;
33
40 bool is_define(int line, int pos);
41
47 void filter_mask_commentaries_and_defines(vector<vector<bool>>& mask);
48
53 vector<vector<bool>> build_mask_valid_code();
54
59 set<array<int,5>> find_start_end_and_depth_of_brackets();
60
65 set<array<int,4>> find_start_end_of_brackets_of_given_depth();
66
75 vector<string> build_function_content(int start_number_line, int start_column, int end_number_line, int end_column);
76
83 bool move_pointer_until_character_outside_parenteses(int &line, int &column);
84
91 tuple<string,int,vector<string>> extract_header_related_information(int start_line, int start_column);
92
101 bool is_body_function_empty(int start_number_line, int start_column, int end_number_line, int end_column);
102
111 void process_function(int start_number_line, int start_column, int end_number_line, int end_column, string relative_path);
112
119 string file_path_from_folder_path(string file_path, string folder_path);
120
126 void file_breaker_c(string file_path, string folder_path);
127
128 public:
134 FunctionBreakerC(string file_path, string folder_path);
135};
136
137#endif
FunctionBreakerC(string file_path, string folder_path)
Constructs function breaker and processes file.
Function breaker utilities and constants.
Defines utility functions used across all files.