standardese/cppast

How to get the initialization block of the constructor?

littleGnAl opened this issue · 3 comments

I want to get the initialization block of the constructor, so I can get the default value of the member variable, e.g.

struct AudioTrackConfig {
  bool enableLocalPlayback;
  AudioTrackConfig() : enableLocalPlayback(true) {}
};

It seems there's not enough information to do this by parsing the cpp_constructor, can you give me some guide to do this?

That is part of the definition, and cppast doesn't expose the definitions of entities. You have to use libclang or libtooling directly.

Is possible for cppast to support it?

Not without a lot of work, which I don't have the time or energy for.