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

Path manipulation class for tool-specific directory structure. More...

#include <path.hpp>

Public Member Functions

bool is_empty () const
 Checks if path is empty.
 
 Path ()=default
 Default constructor.
 
 Path (const fs::path &path)
 Constructs from path string.
 
std::string build_source_path () const
 Builds source file path.
 
std::string build_header_path () const
 Builds header file path.
 
std::string build_info_path () const
 Builds metadata file path.
 
std::string build_relative_path () const
 Builds relative path portion.
 
std::string build_function_name () const
 Extracts function name from path.
 
std::vector< std::string > get_common_folders (const Path &path) const
 Finds common folders with another path.
 
bool contains_given_pattern (const std::string &pattern) const
 Checks for pattern in path.
 
bool operator< (const Path &path) const
 Path comparison operator.
 
std::string format_path_message_in_pair () const
 Formats path for display.
 

Detailed Description

Path manipulation class for tool-specific directory structure.

Manages paths to source files, headers, and metadata in the temporary codebase. Provides methods for path construction and analysis without file I/O.

Definition at line 27 of file path.hpp.

Constructor & Destructor Documentation

◆ Path() [1/2]

Path::Path ( )
default

Default constructor.

◆ Path() [2/2]

Path::Path ( const fs::path & path)
explicit

Constructs from path string.

Parameters
pathPath to parse

Definition at line 33 of file path.cpp.

Member Function Documentation

◆ build_function_name()

std::string Path::build_function_name ( ) const

Extracts function name from path.

Returns
string Function name without extension

Definition at line 110 of file path.cpp.

◆ build_header_path()

std::string Path::build_header_path ( ) const

Builds header file path.

Returns
string Path to header file

Definition at line 61 of file path.cpp.

◆ build_info_path()

std::string Path::build_info_path ( ) const

Builds metadata file path.

Returns
string Path to JSON metadata file

Definition at line 65 of file path.cpp.

◆ build_relative_path()

std::string Path::build_relative_path ( ) const

Builds relative path portion.

Returns
string Relative path

Definition at line 101 of file path.cpp.

◆ build_source_path()

std::string Path::build_source_path ( ) const

Builds source file path.

Returns
string Path to source file

Definition at line 57 of file path.cpp.

◆ contains_given_pattern()

bool Path::contains_given_pattern ( const std::string & pattern) const

Checks for pattern in path.

Parameters
patternPattern to search for
Returns
bool True if pattern found

Definition at line 140 of file path.cpp.

◆ format_path_message_in_pair()

std::string Path::format_path_message_in_pair ( ) const

Formats path for display.

Returns
string Formatted path string

Definition at line 145 of file path.cpp.

◆ get_common_folders()

std::vector< std::string > Path::get_common_folders ( const Path & path) const

Finds common folders with another path.

Parameters
pathOther path to compare
Returns
vector<string> Common base folders

Definition at line 119 of file path.cpp.

◆ is_empty()

bool Path::is_empty ( ) const

Checks if path is empty.

Returns
bool True if no path components

Definition at line 29 of file path.cpp.

◆ operator<()

bool Path::operator< ( const Path & path) const

Path comparison operator.

Parameters
pathOther path to compare
Returns
bool True if this path is ordered first

Definition at line 136 of file path.cpp.


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