Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to extract ALL typedefs and structs and unions from c++ source
    primarykey
    data
    text
    <p>I have inherited a Visual Studio project that contains hundreds of files. </p> <p>I would like to extract all the typedefs, structs and unions from each <em>.h/</em>.cpp file and put the results in a file).</p> <p>Each typdef/struct/union should be on one line in the results file. This would make sorting much easier. </p> <p><strong>typdef</strong> int myType;<br> <strong>struct myFirstStruct</strong> { char a; int b;...};<br> <strong>union</strong> Part_Number_Serial_Number_Part_2_Response_Message_Type {struct{Message_Response_Head_Type Head; Part_Num_Serial_Num_Part_2_Report_Array Part_2_Report; Message_Tail_Type Tail;} Data; BYTE byData[140];}<strong>myUnion</strong>;<br> <strong>struct</strong> { bool c; int d;...}<strong>mySecondStruct</strong>; </p> <p>My problem is, I do not know what to look for (grammar of typedef/structs/unions) using a regular expression. I cannot believe that nobody has done this before (I googled and have not found anything on this).</p> <p>Does anyone know the regular expressions for these? (Note some are commented out using // others /* */) </p> <p>Or a tool to accomplish this. </p> <p><strong>Edit:</strong><br> I am toying with the idea of autogenerating source code and/or dialogs for modifying messages that use the underlying typedef/struct/union. I was going to use the output to generate an XML file that could be used for this reason. </p> <p>The source for these are in C/C++ and used in almost all my projects. These projects are usually NOT in C/C++. By using the XML version I would only need to update/add the typedef/struct/union only in one place and all the projects would be able to autogen the source and/or dialogs.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload