0

I can't find a way to get a "fully qualified name" for a template type without it's arguments, just plain name.

I.e. for a type which spells NS::NS::TemplatedType<int, char> just NS::NS::TemplatedType.

I know it's possible to do for a cursor in a field declaration; I just use:

plain_type_name = "::".join([c.spelling for c in cursor.get_children()])

Unfortunately in my case I don't have a cursor, because I've obtained type from a TYPEDEF_DECL cursor via typedef_cursor.underlying_typedef_type. So I guess I can just work with a type.

I am trying to process a typedef declaration like typedef NS::NS::TemplatedType<int, char> TTic; and I want to drop template arguments from the source type.

My target is python code but if I get a c++ solution I can work my way and translate it. Obviously I'd like to avoid regexping the spelling.

luk32
  • 15,812
  • 38
  • 62
  • What would you expect to get for a type like A::B::C? – Max Langhof Apr 20 '18 at 07:39
  • `A::B::C` just plain names, even for nested types. But currently I don't have such cases in my code base, so either solution to this problem is fine with me. I think it should be easy to adapt solution either way if I had one. – luk32 Apr 20 '18 at 10:51

0 Answers0