开发者

Doxygen a Switch

I have quite a large switch statement (or equally a large if statement) that I would like to document some how in Doxygen, perhaps in it's Caller Graph, or maybe in a some Flow Chart form开发者_开发知识库at.

How can I achieve this ? Thanks !


Usually doxygen is only used to document overall functions. However, I tried something like this.

/// Foo Function
void Foo(void)
{
   /// if switch \a condition equals
   switch (condition)
   {
      case VALUE_1:
      {
         /// - Path 1 \n
         /// Detailed explanation of path A.
         Foo1();
         break;
      }
      case VALUE_2:
      {
         /// - Path 2 \n
         /// Detailed explanation of path B.
         Foo2();
         break;
      }
      case VALUE_3:
      {
         /// - Path3 \n
         /// Detailed explanation of path C.
         Foo3();
         break;
      }
      case default:
      {
         /// - Default Case
         ///Something went wrong
      }
   }//end switch
}

This put a detailed description under the function Foo, and create a bulleted list of each of the cases. Remember to put the "-" to create a bulletd list. As far as generating call graphs, you could try using the \dot keyword. However, I never used it, and think it's to much work to create a truly useful diagram that explains the path.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜