Fixed formatting

This commit is contained in:
Bartek Kryza
2023-01-13 18:24:26 +01:00
parent ada11c6047
commit 7153666087
6 changed files with 10 additions and 10 deletions

View File

@@ -569,7 +569,6 @@ template <typename C, typename D> void generator<C, D>::init_env()
auto element_opt = m_model.get_with_namespace( auto element_opt = m_model.get_with_namespace(
args[0]->get<std::string>(), m_config.using_namespace()); args[0]->get<std::string>(), m_config.using_namespace());
if (!element_opt.has_value()) if (!element_opt.has_value())
throw clanguml::error::uml_alias_missing( throw clanguml::error::uml_alias_missing(
args[0]->get<std::string>()); args[0]->get<std::string>());

View File

@@ -140,7 +140,8 @@ diagram::files() const
} }
common::optional_ref<clanguml::common::model::diagram_element> common::optional_ref<clanguml::common::model::diagram_element>
diagram::get_with_namespace(const std::string &name, const common::model::namespace_ &ns) const diagram::get_with_namespace(
const std::string &name, const common::model::namespace_ &ns) const
{ {
// Convert to preferred OS path // Convert to preferred OS path
std::filesystem::path namePath{name}; std::filesystem::path namePath{name};

View File

@@ -60,7 +60,8 @@ public:
const common::reference_vector<common::model::source_file> &files() const; const common::reference_vector<common::model::source_file> &files() const;
common::optional_ref<clanguml::common::model::diagram_element> common::optional_ref<clanguml::common::model::diagram_element>
get_with_namespace(const std::string &name, const common::model::namespace_ &ns) const override; get_with_namespace(const std::string &name,
const common::model::namespace_ &ns) const override;
inja::json context() const override; inja::json context() const override;

View File

@@ -303,20 +303,20 @@ std::size_t hash_seed(std::size_t seed)
return kSeedStart + (seed << kSeedShiftFirst) + (seed >> kSeedShiftSecond); return kSeedStart + (seed << kSeedShiftFirst) + (seed >> kSeedShiftSecond);
} }
std::string path_to_url(const std::filesystem::path& p) { std::string path_to_url(const std::filesystem::path &p)
{
std::vector<std::string> path_tokens; std::vector<std::string> path_tokens;
auto it = p.begin(); auto it = p.begin();
if(p.has_root_directory()) if (p.has_root_directory())
it++; it++;
for(; it != p.end(); it++) for (; it != p.end(); it++)
path_tokens.push_back(it->string()); path_tokens.push_back(it->string());
if(p.has_root_directory()) if (p.has_root_directory())
return fmt::format("/{}", fmt::join(path_tokens, "/")); return fmt::format("/{}", fmt::join(path_tokens, "/"));
else else
return fmt::format("{}", fmt::join(path_tokens, "/")); return fmt::format("{}", fmt::join(path_tokens, "/"));
} }
} // namespace clanguml::util } // namespace clanguml::util

View File

@@ -257,6 +257,6 @@ std::size_t hash_seed(std::size_t seed);
* @param p Path to convert * @param p Path to convert
* @return String representation of the path in URL format * @return String representation of the path in URL format
*/ */
std::string path_to_url(const std::filesystem::path& p); std::string path_to_url(const std::filesystem::path &p);
} // namespace clanguml::util } // namespace clanguml::util

View File

@@ -21,7 +21,6 @@
#include "common/model/namespace.h" #include "common/model/namespace.h"
TEST_CASE("Test namespace_", "[unit-test]") TEST_CASE("Test namespace_", "[unit-test]")
{ {
using clanguml::common::model::namespace_; using clanguml::common::model::namespace_;