Arkanjo 0.1
A tool for find code duplicated functions in codebases
Loading...
Searching...
No Matches
function.hpp
Go to the documentation of this file.
1
13#ifndef FUNCTION_HPP
14#define FUNCTION_HPP
15
16#include <string>
17#include <vector>
18#include <array>
19#include <iostream>
20
21#include "path.hpp"
22#include "utils.hpp"
24using namespace std;
25using json = nlohmann::json;
26
33class Function {
34 private:
35 string LINE_DECLARATION_JSON = "line_declaration";
36 string START_NUMBER_LINE_JSON = "start_number_line";
37 string END_NUMBER_LINE_JSON = "end_number_line";
38
39 string FUNCTION_PREFIX_PRINT = "Function Name: ";
40 string RELATIVE_PATH_PRINT = "Relative Path: ";
41 string LINE_DECLARATION_PRINT = "Starts on line: ";
42 string END_DECLARATION_PRINT = "Ends on line: ";
43 string NUMBER_LINE_PRINT = "Total number of lines: ";
44
45 Path path;
46 vector<string> content;
47 vector<string> header;
48 int start_number_line;
49 int line_declaration;
50 int end_number_line;
51
55 void read_content();
56
60 void read_header();
61
65 void read_info();
66
67 public:
72 int number_of_lines();
73
78 Function(Path _path);
79
87 array<int,3> get_scope_function_in_file();
88
93 vector<string> get_header();
94
99 vector<string> build_all_content();
100
104 void print_basic_info();
105};
106
107#endif
Represents a code function with its content and metadata.
Definition function.hpp:33
vector< string > build_all_content()
Builds combined content of header and source.
Definition function.cpp:42
array< int, 3 > get_scope_function_in_file()
Gets the function's line number scope.
Definition function.cpp:34
void print_basic_info()
Prints formatted function information to console.
Definition function.cpp:60
vector< string > get_header()
Gets the function's header content.
Definition function.cpp:38
Function(Path _path)
Constructs a Function object.
Definition function.cpp:24
int number_of_lines()
Calculates the total number of lines in the function.
Definition function.cpp:20
Path manipulation class for tool-specific directory structure.
Definition path.hpp:27
nlohmann::json json
Definition function.hpp:25
Definition json.hpp:5678
Path abstraction for temporary codebase.
Defines utility functions used across all files.