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


C++ ListOfStrings::begin方法代码示例

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


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

示例1: Apply

  bool StorePeerCommand::Apply(ListOfStrings& outputs,
                               const ListOfStrings& inputs)
  {
    // Configure the HTTP client
    HttpClient client;
    client.SetProxy(Configuration::GetGlobalStringParameter("HttpProxy", ""));
    if (peer_.GetUsername().size() != 0 && 
        peer_.GetPassword().size() != 0)
    {
      client.SetCredentials(peer_.GetUsername().c_str(), 
                            peer_.GetPassword().c_str());
    }

    client.SetUrl(peer_.GetUrl() + "instances");
    client.SetMethod(HttpMethod_Post);

    for (ListOfStrings::const_iterator
           it = inputs.begin(); it != inputs.end(); ++it)
    {
      LOG(INFO) << "Sending resource " << *it << " to peer \"" 
                << peer_.GetUrl() << "\"";

      try
      {
        context_.ReadFile(client.AccessPostData(), *it, FileContentType_Dicom);

        std::string answer;
        if (!client.Apply(answer))
        {
          LOG(ERROR) << "Unable to send resource " << *it << " to peer \"" << peer_.GetUrl() << "\"";
          throw OrthancException(ErrorCode_NetworkProtocol);
        }

        // Only chain with other commands if this command succeeds
        outputs.push_back(*it);
      }
      catch (OrthancException& e)
      {
        LOG(ERROR) << "Unable to forward to an Orthanc peer in a Lua script (instance " 
                   << *it << ", peer " << peer_.GetUrl() << "): " << e.What();

        if (!ignoreExceptions_)
        {
          throw;
        }
      }
    }

    return true;
  }
开发者ID:dhanzhang,项目名称:orthanc,代码行数:50,代码来源:StorePeerCommand.cpp

示例2:

const char *PropertySet::getPropertyName(int which) {
	ListOfStrings *propNames = (ListOfStrings *) propertyNameList;
	int i = 0;
	for (ListOfStrings::iterator itr = propNames->begin(); itr != propNames->end(); itr++, i++) {
		if (i == which) {
			std::string s = *itr;
			char *pc = new char[strlen(s.c_str())+1];
			strcpy(pc, s.c_str());
			return pc;
		}
	}
	return(NULL);

}
开发者ID:elumenati,项目名称:omnimap,代码行数:14,代码来源:Property.cpp

示例3: Apply

  bool DeleteInstanceCommand::Apply(ListOfStrings& outputs,
                                    const ListOfStrings& inputs)
  {
    for (ListOfStrings::const_iterator
           it = inputs.begin(); it != inputs.end(); ++it)
    {
      LOG(INFO) << "Deleting instance " << *it;

      try
      {
        Json::Value tmp;
        context_.DeleteResource(tmp, *it, ResourceType_Instance);
      }
      catch (OrthancException& e)
      {
        LOG(ERROR) << "Unable to delete instance " << *it << " in a Lua script: " << e.What();
      }
    }

    return true;
  }
开发者ID:dhanzhang,项目名称:orthanc,代码行数:21,代码来源:DeleteInstanceCommand.cpp

示例4: Apply

  bool StoreScuCommand::Apply(ListOfStrings& outputs,
                             const ListOfStrings& inputs)
  {
    ReusableDicomUserConnection::Locker locker(context_.GetReusableDicomUserConnection(), localAet_, modality_);

    for (ListOfStrings::const_iterator
           it = inputs.begin(); it != inputs.end(); ++it)
    {
      LOG(INFO) << "Sending resource " << *it << " to modality \"" 
                << modality_.GetApplicationEntityTitle() << "\"";

      try
      {
        std::string dicom;
        context_.ReadFile(dicom, *it, FileContentType_Dicom);

        locker.GetConnection().Store(dicom, moveOriginatorID_);

        // Only chain with other commands if this command succeeds
        outputs.push_back(*it);
      }
      catch (OrthancException& e)
      {
        // Ignore transmission errors (e.g. if the remote modality is
        // powered off)
        LOG(ERROR) << "Unable to forward to a modality in a Lua script (instance " 
                   << *it << "): " << e.What();

        if (!ignoreExceptions_)
        {
          throw;
        }
      }
    }

    return true;
  }
开发者ID:151706061,项目名称:OrthancMirror,代码行数:37,代码来源:StoreScuCommand.cpp


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