10 std::string function_message = FUNCTION_PREFIX_PRINT + function.
name();
12 std::string relative_message = RELATIVE_PATH_PRINT + relative_path.string();
13 std::string start_message = LINE_DECLARATION_PRINT + std::to_string(location.declaration + 1) +
14 "-" + std::to_string(location.end + 1);
15 std::string number_message = NUMBER_LINE_PRINT + std::to_string(location.size());
17 std::cout <<
YELLOW(function_message) <<
'\n';
18 std::cout <<
GREEN(relative_message) <<
'\n';
19 std::cout <<
WHITE(start_message) <<
'\n';
20 std::cout <<
WHITE(number_message) <<
'\n';
28 for (
const auto& line : lines) {
30 std::ostringstream oss;
31 oss << std::setw(4) << line_number++;
33 std::cout <<
CYAN(oss.str()) <<
" | " << line <<
'\n';
35 std::cout << line <<
'\n';
41 const auto& path = function.
path();
43 return path.
relative_path().string() + BETWEEN_RELATIVE_AND_FUNCTION_NAME + function.
name();
static void print_basic_info(const Function &function)
Prints formatted function information to console.
static void print_code(const Function &function, bool no_numbers=false)
Prints the function source code.
static std::string format_path_message_in_pair(const Function &function)
Formats path for display.
Represents a function extracted from a codebase.
const Path & path() const
Gets the function path information.
std::vector< std::string > build_all_content() const
Builds combined content of header and source.
const std::string & name() const
Gets the function name.
const FunctionLocation & scope_location() const
Gets the function location inside the source file.
fs::path relative_path() const
Gets the directory portion of the path.
static PreprocessRunParams read_current_run_params()
read preprocessing parameters runs
Provides utilities for printing function information and source code.
uint32_t declaration
Line number of function declaration.