Is there a simple way to convert C++ enum to string?

后端 未结 30 2279
我在风中等你
我在风中等你 2020-11-22 10:37

Suppose we have some named enums:

enum MyEnum {
      FOO,
      BAR = 0x50
};

What I googled for is a script (any language) that scans all

30条回答
  •  遇见更好的自我
    2020-11-22 10:52

    You may want to check out GCCXML.

    Running GCCXML on your sample code produces:

    
      
      
      
        
        
      
      
    
    

    You could use any language you prefer to pull out the Enumeration and EnumValue tags and generate your desired code.

提交回复
热议问题