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
12
13#ifndef FUNCTION_HPP
14#define FUNCTION_HPP
15
16#include <bits/stdc++.h>
17// WARNING: This import may only work in Ubuntu
18// See: https://github.com/stardust95/TinyCompiler/issues/2
19#include <jsoncpp/json/json.h>
20
21#include "path.hpp"
22#include "utils.hpp"
23using namespace std;
24
31class Function {
32 private:
33 string LINE_DECLARATION_JSON = "line_declaration";
34 string START_NUMBER_LINE_JSON = "start_number_line";
35 string END_NUMBER_LINE_JSON = "end_number_line";
36
37 string FUNCTION_PREFIX_PRINT = "Function Name: ";
38 string RELATIVE_PATH_PRINT = "Relative Path: ";
39 string LINE_DECLARATION_PRINT = "Starts on line: ";
40 string END_DECLARATION_PRINT = "Ends on line: ";
41 string NUMBER_LINE_PRINT = "Total number of lines: ";
42
43 Path path;
44 vector<string> content;
45 vector<string> header;
46 int start_number_line;
47 int line_declaration;
48 int end_number_line;
49
53 void read_content();
54
58 void read_header();
59
63 void read_info();
64
65 public:
70 int number_of_lines();
71
76 Function(Path _path);
77
85 array<int,3> get_scope_function_in_file();
86
91 vector<string> get_header();
92
97 vector<string> build_all_content();
98
102 void print_basic_info();
103};
104
105#endif
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:24
Path abstraction for temporary codebase.
Defines utility functions used across all files.