7#include "nlohmann/json.hpp"
10void FunctionLoader::read_content(
Function& function) {
17void FunctionLoader::read_header(
Function& function) {
24void FunctionLoader::read_info(
Function& function) {
29 function.location_.
declaration = info.value(LINE_DECLARATION_JSON, INVALID_LINE);
30 function.location_.
begin = info.value(START_NUMBER_LINE_JSON, INVALID_LINE);
31 function.location_.
end = info.value(END_NUMBER_LINE_JSON, INVALID_LINE);
40 function.name_ = path.
value().stem().string();
42 read_content(function);
43 read_header(function);
55 function.name_ = path.
value().stem().string();
Function load(const Path &path)
Loads a function from a path.
Function load_metadata(const Path &path)
Loads function metadata from a path.
fs::path build_header_path(const Path &path) const
Builds header file path.
fs::path build_source_path(const Path &path) const
Builds source file path.
fs::path build_info_path(const Path &path) const
Builds metadata file path.
Represents a function extracted from a codebase.
const Path & path() const
Gets the function path information.
Represents a logical path to a function in the codebase.
bool empty() const
Checks if path is empty.
const fs::path & value() const
Gets the underlying filesystem path.
Provides functionality to load Function objects from external sources.
Provides access to function storage locations.
json read_json(const fs::path &string_path)
Reads and parses a JSON file, uses nlohmann json library.
std::vector< std::string > read_file_with_vector(const fs::path &path)
Reads a file line by line into a vector of strings.
Logical path abstraction for source code elements.
uint32_t end
Line number where function ends.
uint32_t declaration
Line number of function declaration.
uint32_t begin
Line number where function starts.
Defines utility functions used across all files.