Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Commit

Permalink
Remove Utils::extractQualifiedNameFromFunctionDefinition and the as…
Browse files Browse the repository at this point in the history
…sociated

Inja callback. It doesn't work properly for members of class templates due to
spaces, and it's no longer needed now that we have the `qualifiedname` field.
  • Loading branch information
brycelelbach committed Dec 24, 2021
1 parent 3bb4cdf commit 6f8128d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
6 changes: 1 addition & 5 deletions src/Doxybook/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static std::string trimPath(std::string path) {

static std::string stripTmplSuffix(std::string path) {
if (path.size() > 4 && path.find(".tmpl") == path.size() - 5) {
path.erase(path.size() - 5);
path.erase(path.size() - 5);
}
return path;
}
Expand Down Expand Up @@ -103,10 +103,6 @@ Doxybook2::Renderer::Renderer(const Config& config,
const auto arg = args.at(0)->get<std::string>();
return Utils::stripNamespace(arg);
});
env->add_callback("extractQualifiedNameFromFunctionDefinition", 1, [](inja::Arguments& args) -> std::string {
const auto arg = args.at(0)->get<std::string>();
return Utils::extractQualifiedNameFromFunctionDefinition(arg);
});
env->add_callback("split", 2, [](inja::Arguments& args) -> nlohmann::json {
const auto arg0 = args.at(0)->get<std::string>();
const auto arg1 = args.at(1)->get<std::string>();
Expand Down
12 changes: 0 additions & 12 deletions src/Doxybook/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,6 @@ std::string Doxybook2::Utils::stripAnchor(const std::string& str) {
return ss.str();
}

static const std::regex FUNCTION_DEFINITION_REGEX(R"(^.* ([a-zA-Z0-9_::+*/%^&|~!=<>()\[\],-]+)$)");

std::string Doxybook2::Utils::extractQualifiedNameFromFunctionDefinition(const std::string& str) {
std::smatch matches;
if (std::regex_match(str, matches, FUNCTION_DEFINITION_REGEX)) {
if (matches.size() == 2) {
return matches[1].str();
}
}
return str;
}

std::string Doxybook2::Utils::escape(std::string str) {
size_t new_size = 0;
for (const auto& c : str) {
Expand Down

0 comments on commit 6f8128d

Please # to comment.