|
Arkanjo 0.2
A tool for find code duplicated functions in codebases
|
Function breaker utilities and constants. More...
#include <string>#include <vector>#include <filesystem>#include <arkanjo/base/config.hpp>#include <arkanjo/utils/utils.hpp>
Include dependency graph for function_breaker_util.hpp:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| struct | Line_content |
| Structure representing a line of source code. More... | |
Enumerations | |
| enum | PROGRAMMING_LANGUAGE { C , JAVA } |
| Enumeration of supported programming languages. More... | |
Functions | |
| string | extract_extension (const fs::path &file_path) |
| Extracts file extension from path. | |
| fs::path | build_source_path (const fs::path &relative_path, const string &function_name) |
| Builds source file path for a function. | |
| fs::path | build_header_path (const fs::path &relative_path, const string &function_name) |
| Builds header file path for a function. | |
| fs::path | build_info_path (const fs::path &relative_path, const string &function_name) |
| Builds info file path for a function. | |
| void | create_source_file (int start_number_line, int end_number_line, const fs::path &relative_path, const string &function_name, const vector< string > &function_content) |
| Creates source file for a function. | |
| void | create_header_file (const fs::path &relative_path, const string &function_name, const vector< string > &header_content) |
| Creates header file for a function. | |
| void | create_info_file (int line_declaration, int start_number_line, int end_number_line, const fs::path &relative_path, const string &function_name) |
| Creates JSON metadata file for a function. | |
Variables | |
| const string | SOURCE_PATH = "source" |
| Directory name for source files. | |
| const string | HEADER_PATH = "header" |
| Directory name for header files. | |
| const string | INFO_PATH = "info" |
| Directory name for metadata files. | |
Function breaker utilities and constants.
Defines common utilities, structures, and constants used across the function breaking process for supported programming languages.
Defines util functions, struct and constants used across the function breaker process for the suported languages
Definition in file function_breaker_util.hpp.
| enum PROGRAMMING_LANGUAGE |
Enumeration of supported programming languages.
| Enumerator | |
|---|---|
| C | C programming language. |
| JAVA | Java programming language. |
Definition at line 35 of file function_breaker_util.hpp.
| fs::path build_header_path | ( | const fs::path & | relative_path, |
| const string & | function_name ) |
Builds header file path for a function.
| relative_path | Relative path of the original file |
| function_name | Name of the function |
Definition at line 18 of file function_breaker_util.cpp.
| fs::path build_info_path | ( | const fs::path & | relative_path, |
| const string & | function_name ) |
Builds info file path for a function.
| relative_path | Relative path of the original file |
| function_name | Name of the function |
Definition at line 27 of file function_breaker_util.cpp.
| fs::path build_source_path | ( | const fs::path & | relative_path, |
| const string & | function_name ) |
Builds source file path for a function.
| relative_path | Relative path of the original file |
| function_name | Name of the function |
Definition at line 9 of file function_breaker_util.cpp.
| void create_header_file | ( | const fs::path & | relative_path, |
| const string & | function_name, | ||
| const vector< string > & | header_content ) |
Creates header file for a function.
| relative_path | Relative path of the original file |
| function_name | Name of the function |
| header_content | Vector of strings containing the header content |
Definition at line 41 of file function_breaker_util.cpp.
| void create_info_file | ( | int | line_declaration, |
| int | start_number_line, | ||
| int | end_number_line, | ||
| const fs::path & | relative_path, | ||
| const string & | function_name ) |
Creates JSON metadata file for a function.
| line_declaration | Line number where function is declared |
| start_number_line | Starting line number of function body |
| end_number_line | Ending line number of function body |
| relative_path | Relative path of the original file |
| function_name | Name of the function |
Definition at line 47 of file function_breaker_util.cpp.
| void create_source_file | ( | int | start_number_line, |
| int | end_number_line, | ||
| const fs::path & | relative_path, | ||
| const string & | function_name, | ||
| const vector< string > & | function_content ) |
Creates source file for a function.
| start_number_line | Starting line number in original file |
| end_number_line | Ending line number in original file |
| relative_path | Relative path of the original file |
| function_name | Name of the function |
| function_content | Vector of strings containing the function body |
Definition at line 36 of file function_breaker_util.cpp.
| string extract_extension | ( | const fs::path & | file_path | ) |
Extracts file extension from path.
| file_path | Path to the file |
Definition at line 3 of file function_breaker_util.cpp.
| const string HEADER_PATH = "header" |
Directory name for header files.
Definition at line 41 of file function_breaker_util.hpp.
| const string INFO_PATH = "info" |
Directory name for metadata files.
Definition at line 42 of file function_breaker_util.hpp.
| const string SOURCE_PATH = "source" |
Directory name for source files.
Definition at line 40 of file function_breaker_util.hpp.