thibaultmarin / hpp2plantuml

Convert C++ header files to PlantUML
MIT License
223 stars 35 forks source link

concated namespace problem #20

Closed qTp closed 3 months ago

qTp commented 2 years ago

Hello!

Thank you very much for this useful tool.

I found a little problem with namespaces. From the following code:

namespace prefix::test::third{
    class MyClass{};
}

Your tool will create, with the command hpp2plantuml -i test.hpp -o test.puml, this output:

@startuml

/' Objects '/

namespace prefix {
    namespace prefix::test {
        namespace prefix::test::third {
            class MyClass {
            }
        }
    }
}

/' Inheritance relationships '/

/' Aggregation relationships '/

/' Nested objects '/

@enduml

I would expect an output like this:

@startuml

/' Objects '/

namespace prefix::test::third   {   
  class MyClass {
  }
}

/' Inheritance relationships '/

/' Aggregation relationships '/

/' Nested objects '/

@enduml

or like this:

@startuml

/' Objects '/

namespace prefix {
    namespace test {
        namespace third {
            class MyClass {
            }
        }
    }
}

/' Inheritance relationships '/

/' Aggregation relationships '/

/' Nested objects '/

@enduml
qTp commented 2 years ago
namespace test{
  namespace suffix{
    class MyClass{};
  }
}

this will also provied some strange output

@startuml

/' Objects '/

namespace test {
        namespace test::suffix {
                class MyClass {
                }
        }
}

@enduml
thibaultmarin commented 2 years ago

Thanks for the report. v0.8.2 attempts to fix the issue.

thibaultmarin commented 3 months ago

I believe this is fixed, feel free to re-open if needed