Arkanjo 0.1
A tool for find code duplicated functions in codebases
Loading...
Searching...
No Matches
Function Class Reference

Represents a code function with its content and metadata. More...

#include <function.hpp>

Public Member Functions

int number_of_lines ()
 Calculates the total number of lines in the function.
 
 Function (Path _path)
 Constructs a Function object.
 
array< int, 3 > get_scope_function_in_file ()
 Gets the function's line number scope.
 
vector< string > get_header ()
 Gets the function's header content.
 
vector< string > build_all_content ()
 Builds combined content of header and source.
 
void print_basic_info ()
 Prints formatted function information to console.
 

Detailed Description

Represents a code function with its content and metadata.

Provides access to function source, header, line information, and various utility methods for function manipulation and display.

Definition at line 33 of file function.hpp.

Constructor & Destructor Documentation

◆ Function()

Function::Function ( Path _path)

Constructs a Function object.

Parameters
_pathPath object containing function location info

Definition at line 24 of file function.cpp.

Member Function Documentation

◆ build_all_content()

vector< string > Function::build_all_content ( )

Builds combined content of header and source.

Returns
vector<string> Merged content with header and source

Definition at line 42 of file function.cpp.

◆ get_header()

vector< string > Function::get_header ( )

Gets the function's header content.

Returns
vector<string> Each element represents a line of header

Definition at line 38 of file function.cpp.

◆ get_scope_function_in_file()

array< int, 3 > Function::get_scope_function_in_file ( )

Gets the function's line number scope.

Returns
array<int,3> Array containing: [0] - Declaration line [1] - Start line [2] - End line

Definition at line 34 of file function.cpp.

◆ number_of_lines()

int Function::number_of_lines ( )

Calculates the total number of lines in the function.

Returns
int Number of lines from declaration to end (inclusive)

Definition at line 20 of file function.cpp.

◆ print_basic_info()

void Function::print_basic_info ( )

Prints formatted function information to console.

Definition at line 60 of file function.cpp.


The documentation for this class was generated from the following files: