4 std::string ext = file_path.extension().string();
5 if (!ext.empty() && ext[0] ==
'.') ext.erase(0, 1);
13 final_path /= relative_path;
14 final_path /= function_name +
"." + extension;
22 final_path /= relative_path;
23 final_path /= function_name +
"." + extension;
27fs::path
build_info_path(
const fs::path& relative_path,
const string& function_name) {
31 final_path /= relative_path;
32 final_path /= function_name +
".json";
36void 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) {
41void create_header_file(
const fs::path& relative_path,
const string& function_name,
const vector<string>& header_content) {
47void create_info_file(
int line_declaration,
int start_number_line,
int end_number_line,
const fs::path& relative_path,
const string& function_name) {
48 vector<string> content;
49 content.push_back(
"{\n");
50 content.push_back(
"\"file_name\":\"" + relative_path.string() +
"\",\n");
51 content.push_back(
"\"function_name\":\"" + function_name +
"\",\n");
52 content.push_back(
"\"line_declaration\":" + to_string(line_declaration) +
",\n");
53 content.push_back(
"\"start_number_line\":" + to_string(start_number_line) +
",\n");
54 content.push_back(
"\"end_number_line\":" + to_string(end_number_line) +
"\n");
55 content.push_back(
"}\n");
static Config & config()
Gets the singleton configuration instance.
fs::path base_path
Default base path for temporary files.
fs::path name_container
Name of the cache container.
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.
fs::path build_source_path(const fs::path &relative_path, const string &function_name)
Builds source file path 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.
void create_header_file(const fs::path &relative_path, const string &function_name, const vector< string > &header_content)
Creates header file 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.
string extract_extension(const fs::path &file_path)
Extracts file extension from path.
Function breaker utilities and constants.
const string SOURCE_PATH
Directory name for source files.
const string HEADER_PATH
Directory name for header files.
const string INFO_PATH
Directory name for metadata files.
void write_file_generic(const fs::path &file_path, const std::vector< std::string > &content)
Writes content to a file at specified path.