当前位置: 首页>>代码示例>>C++>>正文


C++ ChunkList_t::GetNext方法代码示例

本文整理汇总了C++中ChunkList_t::GetNext方法的典型用法代码示例。如果您正苦于以下问题:C++ ChunkList_t::GetNext方法的具体用法?C++ ChunkList_t::GetNext怎么用?C++ ChunkList_t::GetNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ChunkList_t的用法示例。


在下文中一共展示了ChunkList_t::GetNext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: return

/* @todo maybe it is better to combine chunk_get_next and chunk_get_prev
 * into a common function However this should be done with the preprocessor
 * to avoid addition check conditions that would be evaluated in the
 * while loop of the calling function */
chunk_t *chunk_get_next(chunk_t *cur, nav_t nav)
{
   if (cur == NULL)
   {
      return(NULL);
   }
   chunk_t *pc = g_cl.GetNext(cur);
   if ((pc == NULL) || (nav == CNAV_ALL))
   {
      return(pc);
   }
   if (cur->flags & PCF_IN_PREPROC)
   {
      /* If in a preproc, return NULL if trying to leave */
      if ((pc->flags & PCF_IN_PREPROC) == 0)
      {
         return(NULL);
      }
      return(pc);
   }
   /* Not in a preproc, skip any preproc */
   while ((pc != NULL) && (pc->flags & PCF_IN_PREPROC))
   {
      pc = g_cl.GetNext(pc);
   }
   return(pc);
}
开发者ID:,项目名称:,代码行数:31,代码来源:

示例2: return

/* @todo maybe it is better to combine chunk_get_next and chunk_get_prev
 * into a common function However this should be done with the preprocessor
 * to avoid addition check conditions that would be evaluated in the
 * while loop of the calling function */
chunk_t *chunk_get_next(chunk_t *cur, scope_e scope)
{
   if (cur == nullptr)
   {
      return(nullptr);
   }
   chunk_t *pc = g_cl.GetNext(cur);
   if (pc == nullptr || scope == scope_e::ALL)
   {
      return(pc);
   }
   if (cur->flags & PCF_IN_PREPROC)
   {
      // If in a preproc, return nullptr if trying to leave
      if ((pc->flags & PCF_IN_PREPROC) == 0)
      {
         return(nullptr);
      }
      return(pc);
   }
   // Not in a preproc, skip any preproc
   while (pc != nullptr && (pc->flags & PCF_IN_PREPROC))
   {
      pc = g_cl.GetNext(pc);
   }
   return(pc);
}
开发者ID:jibsen,项目名称:uncrustify,代码行数:31,代码来源:chunk_list.cpp


注:本文中的ChunkList_t::GetNext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。