Fixed path separators in diagram link URL's in Windows
This commit is contained in:
@@ -303,4 +303,20 @@ std::size_t hash_seed(std::size_t seed)
|
||||
return kSeedStart + (seed << kSeedShiftFirst) + (seed >> kSeedShiftSecond);
|
||||
}
|
||||
|
||||
std::string path_to_url(const std::filesystem::path& p) {
|
||||
std::vector<std::string> path_tokens;
|
||||
auto it = p.begin();
|
||||
if(p.has_root_directory())
|
||||
it++;
|
||||
|
||||
for(; it != p.end(); it++)
|
||||
path_tokens.push_back(it->string());
|
||||
|
||||
if(p.has_root_directory())
|
||||
return fmt::format("/{}", fmt::join(path_tokens, "/"));
|
||||
else
|
||||
return fmt::format("{}", fmt::join(path_tokens, "/"));
|
||||
|
||||
}
|
||||
|
||||
} // namespace clanguml::util
|
||||
|
||||
Reference in New Issue
Block a user