T O P I C R E V I E W |
peterchen |
Posted - Aug 06 2009 : 06:07:12 AM Can the autotext (or anything else) be bent to create an appropriate switch statement over all enums in an definition?
i.e. going from
quote: enum EFoo { fooA = 17 fooB = 20, fooC };
to
quote: switch (foo) { case fooA: break; case fooB: break; case fooC: break; default: break; }
|
2 L A T E S T R E P L I E S (Newest First) |
sean |
Posted - Aug 21 2015 : 12:26:50 AM case=19137 is implemented in build 2073 as the command "Add Missing Case Statements" |
feline |
Posted - Aug 06 2009 : 3:32:02 PM I believe you can do this with IDE Snippets in C#, but I am not sure of the exact details off hand. The IDE does not offer this feature in C++.
We are considering adding this ability to VA:
case=19137
For now you might be able to do something with an IDE macro, or perhaps something with a regular expression search and replace to turn the enum items into a switch statement. I know this is not ideal, but it might be worth looking at if you do this a lot. |