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
11#ifndef FUNCTION_BREAKER_C_HPP
12#define FUNCTION_BREAKER_C_HPP
13
14#include <cassert>
15#include <string>
16#include <vector>
17#include <set>
18#include <array>
19#include <tuple>
20#include "../base/utils.hpp"
22
31 const int NUMBER_OF_LINES_BEFORE_FOR_FUNCTION_NAME = 7;
32 const int C_RELEVANT_DEPTH = 0;
33 const bool IGNORE_EMPTY_FUNCTIONS = true;
34 const bool ALLOW_STRUCTS = false;
35
36 vector<string> file_content;
37 vector<vector<bool>> mask_valid;
38
45 bool is_define(int line, int pos);
46
52 void filter_mask_commentaries_and_defines(vector<vector<bool>>& mask);
53
58 vector<vector<bool>> build_mask_valid_code();
59
64 set<array<int,5>> find_start_end_and_depth_of_brackets();
65
70 set<array<int,4>> find_start_end_of_brackets_of_given_depth();
71
80 vector<string> build_function_content(int start_number_line, int start_column, int end_number_line, int end_column);
81
88 bool move_pointer_until_character_outside_parenteses(int &line, int &column);
89
96 tuple<string,int,vector<string>> extract_header_related_information(int start_line, int start_column);
97
106 bool is_body_function_empty(int start_number_line, int start_column, int end_number_line, int end_column);
107
116 void process_function(int start_number_line, int start_column, int end_number_line, int end_column, string relative_path);
117
124 string file_path_from_folder_path(string file_path, string folder_path);
125
131 void file_breaker_c(string file_path, string folder_path);
132
133 public:
139 FunctionBreakerC(string file_path, string folder_path);
140};
141
142#endif
C/C++ function parser and extractor.
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.