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


C++ Link::empty方法代码示例

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


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

示例1: note

void note(int usecs)
 {
 Ttask *t;
 for(t=timer_tasks.next;t;t=t->link.next)
   if(t->usecs>0)
     {
     t->usecs-=usecs;
     }
 while (!timer_tasks.empty() && timer_tasks.next->usecs<=0)
   {
   t=timer_tasks.next;
   timer_tasks.deque(t);
   t->fn->cont(t->fn);
   delete t;
   }
 }
开发者ID:baruch,项目名称:joes-sandbox,代码行数:16,代码来源:io.c

示例2: linkFromNode

bool Parser::linkFromNode(const XMLNode& linkNode, Link& linkInfo)
{
  if (!linkNode.isElementNode() or (linkNode.getNameAsString() != "link"))
    return false;

  //link should not have any child nodes
  if (linkNode.hasChild())
    return false;

  const auto attributes = linkNode.getAttributes();
  if (attributes.empty())
  {
    std::cout << "Link element should have at least one attribute!" << std::endl;
    return false;
  } //if not enough attributes

  //initialize element with empty values
  linkInfo = Link();
  for (const auto& a : attributes)
  {
    const std::string attrName = a.first;
    if (attrName == "href")
    {
      if (!linkInfo.href().empty())
      {
        std::cout << "Link element already has a href value!" << std::endl;
        return false;
      } //if href was already specified
      linkInfo.setHref(a.second);
    } //if href
    else if (attrName == "rel")
    {
      if (!linkInfo.rel().empty())
      {
        std::cout << "Link element already has a rel attribute!" << std::endl;
        return false;
      } //if rel was already specified
      linkInfo.setRel(a.second);
    } //if rel
    else if (attrName == "type")
    {
      if (!linkInfo.type().empty())
      {
        std::cout << "Link element already has a type attribute!" << std::endl;
        return false;
      } //if type was already specified
      linkInfo.setType(a.second);
    } //if type
    else if (attrName == "hreflang")
    {
      if (!linkInfo.hreflang().empty())
      {
        std::cout << "Link element already has a hreflang attribute!" << std::endl;
        return false;
      } //if hreflang was already specified
      linkInfo.setHreflang(a.second);
    } //if hreflang
    else if (attrName == "title")
    {
      if (!linkInfo.title().empty())
      {
        std::cout << "Link element already has a title attribute!" << std::endl;
        return false;
      } //if title was already specified
      linkInfo.setTitle(a.second);
    } //if title
    else if (attrName == "length")
    {
      if (linkInfo.length() > 0)
      {
        std::cout << "Link element already has a length attribute!" << std::endl;
        return false;
      } //if length was already specified
      uint64_t tempUnsigned = 0;
      if (!stringToUnsignedInt<uint64_t>(a.second, tempUnsigned))
      {
        std::cout << "Length attribute of link element must have an integer value!" << std::endl;
        return false;
      }
      if (tempUnsigned == 0)
      {
        std::cout << "Length attribute of link element must not be zero!" << std::endl;
        return false;
      }
      linkInfo.setLength(tempUnsigned);
    } //if length
    else
    {
      std::cout << "Error: found unknown attribute " << a.first
                << " in <link> element of Atom 1.0 feed!" << std::endl;
      return false;
    }
  } //for
  //structure should not be empty
  return (!linkInfo.empty());
}
开发者ID:Thoronador,项目名称:feed-merger,代码行数:96,代码来源:Parser.cpp

示例3: Alloc

 Alloc()
  : mutex("!StdioAllocMutex")
  {
   list.empty();
  }
开发者ID:SergeyStrukov,项目名称:CCore-2-99,代码行数:5,代码来源:stdio.cpp

示例4: ObjPool

      ObjPool()
       {
        list.empty();

        for(Obj *ptr=reserved,*lim=ptr+FOPEN_MAX; ptr<lim ;ptr++) put(ptr);
       }
开发者ID:SergeyStrukov,项目名称:CCore-2-99,代码行数:6,代码来源:stdio.cpp


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