Initial refactor of namespace handling
This commit is contained in:
@@ -39,7 +39,7 @@ std::string to_string(CXString &&cxs)
|
||||
}
|
||||
|
||||
std::string full_name(
|
||||
const std::vector<std::string> ¤t_ns, const cppast::cpp_entity &e)
|
||||
const common::model::namespace_ ¤t_ns, const cppast::cpp_entity &e)
|
||||
{
|
||||
if (e.name().empty())
|
||||
return "";
|
||||
@@ -126,12 +126,13 @@ bool is_inside_class(const cppast::cpp_entity &e)
|
||||
return false;
|
||||
}
|
||||
|
||||
std::pair<std::vector<std::string>, std::string> split_ns(
|
||||
std::pair<common::model::namespace_, std::string> split_ns(
|
||||
const std::string &full_name)
|
||||
{
|
||||
auto name_before_template = ::clanguml::util::split(full_name, "<")[0];
|
||||
auto ns = ::clanguml::util::split(name_before_template, "::");
|
||||
auto name = ns.back();
|
||||
auto ns = common::model::namespace_{
|
||||
::clanguml::util::split(name_before_template, "::")};
|
||||
auto name = ns.name();
|
||||
ns.pop_back();
|
||||
return {ns, name};
|
||||
}
|
||||
@@ -197,7 +198,7 @@ std::string ns(const cppast::cpp_type &t, const cppast::cpp_entity_index &idx)
|
||||
}
|
||||
|
||||
std::string fully_prefixed(
|
||||
const std::vector<std::string> ¤t_ns, const cppast::cpp_entity &e)
|
||||
const common::model::namespace_ ¤t_ns, const cppast::cpp_entity &e)
|
||||
{
|
||||
if (e.name().find("::") != std::string::npos) {
|
||||
// the name already contains namespace, but it could be not
|
||||
|
||||
Reference in New Issue
Block a user