Merge pull request #148 from bkryza/add-packages-from-directory-structure

Add packages from directory structure
This commit is contained in:
Bartek Kryza
2023-05-28 22:58:45 +02:00
committed by GitHub
291 changed files with 7038 additions and 4416 deletions

View File

@@ -754,4 +754,30 @@ std::vector<std::string> tokenize_unexposed_template_parameter(
return result;
}
bool parse_source_location(const std::string &location_str, std::string &file,
unsigned &line, unsigned &column)
{
auto tokens = util::split(location_str, ":");
if (tokens.size() < 3)
return false;
file = tokens.at(0);
try {
line = std::stoi(tokens.at(1));
}
catch (std::invalid_argument &e) {
line = 0;
}
try {
column = std::stoi(tokens.at(2));
}
catch (std::invalid_argument &e) {
column = 0;
}
return true;
}
} // namespace clanguml::common