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


C++ StringCollection类代码示例

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


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

示例1: onLaunchDebugServer

ErrorCode PlatformSessionImpl::onLaunchDebugServer(Session &session,
                                                   std::string const &host,
                                                   uint16_t &port,
                                                   ProcessId &pid) {
  ProcessSpawner ps;
  StringCollection args;

  ps.setExecutable(Platform::GetSelfExecutablePath());
  args.push_back("slave");
  if (GetLogLevel() == kLogLevelDebug) {
    args.push_back("--debug");
  } else if (GetLogLevel() == kLogLevelPacket) {
    args.push_back("--debug-remote");
  }
  ps.setArguments(args);
  ps.redirectInputToNull();
  ps.redirectOutputToBuffer();

  ErrorCode error;
  error = ps.run();
  if (error != kSuccess)
    return error;
  error = ps.wait();
  if (error != kSuccess)
    return error;

  if (ps.exitStatus() != 0)
    return kErrorInvalidArgument;

  std::istringstream ss;
  ss.str(ps.output());
  ss >> port >> pid;

  return kSuccess;
}
开发者ID:YtnbFirewings,项目名称:ds2,代码行数:35,代码来源:PlatformSessionImpl.cpp

示例2: beforeCall

void OGDFGemFrick::beforeCall() {
  ogdf::GEMLayout *gem = static_cast<ogdf::GEMLayout*>(ogdfLayoutAlgo);

  if (dataSet != NULL) {
    int ival = 0;
    double dval = 0;
    StringCollection sc;

    if (dataSet->get("number of rounds", ival)) {
      gem->numberOfRounds(ival);
    }

    if (dataSet->get("minimal temperature", dval)) {
      gem->minimalTemperature(dval);
    }

    if (dataSet->get("initial temperature", dval)) {
      gem->initialTemperature(dval);
    }

    if (dataSet->get("gravitational constant", dval)) {
      gem->gravitationalConstant(dval);
    }

    if (dataSet->get("desired length", dval)) {
      gem->desiredLength(dval);
    }

    if (dataSet->get("maximal disturbance", dval)) {
      gem->maximalDisturbance(dval);
    }

    if (dataSet->get("rotation angle", dval)) {
      gem->rotationAngle(dval);
    }

    if (dataSet->get("oscillation angle", dval)) {
      gem->oscillationAngle(dval);
    }

    if (dataSet->get("rotation sensitivity", dval)) {
      gem->rotationSensitivity(dval);
    }

    if (dataSet->get("oscillation sensitivity", dval)) {
      gem->oscillationSensitivity(dval);
    }

    if (dataSet->get(ELT_ATTRACTIONFORMULA, sc)) {
      gem->attractionFormula(sc.getCurrent() + 1);
    }

    if (dataSet->get("minDistCC", dval))
      gem->minDistCC(dval);

    if (dataSet->get("pageRatio", dval))
      gem->pageRatio(dval);

  }
}
开发者ID:kdbanman,项目名称:browseRDF,代码行数:60,代码来源:OGDFGemFrick.cpp

示例3: GetProcessArguments

bool ProcFS::GetProcessArguments(pid_t pid, StringCollection &args) {
  FILE *fp = ProcFS::OpenFILE(pid, "cmdline");
  if (fp == nullptr)
    return false;

  args.clear();

  std::string arg;
  for (;;) {
    char buf[1024], *end, *bp;
    size_t nread = fread(buf, 1, sizeof(buf), fp);
    if (nread == 0) {
      if (!arg.empty()) {
        args.push_back(arg);
      }
      break;
    }

    bp = buf, end = buf + nread;
    while (bp < end) {
      while (*bp != '\0') {
        arg += *bp++;
      }
      bp++;
      args.push_back(arg);
      arg.clear();
    }
  }

  std::fclose(fp);
  return true;
}
开发者ID:cosql,项目名称:ds2,代码行数:32,代码来源:ProcFS.cpp

示例4: beforeCall

  void beforeCall() {
    ogdf::PlanarizationGridLayout *pgl = static_cast<ogdf::PlanarizationGridLayout*>(ogdfLayoutAlgo);

    if (dataSet != NULL) {
      double dval = 0;
      StringCollection sc;

      if (dataSet->get("page ratio", dval))
        pgl->pageRatio(dval);

      if (dataSet->get(ELT_PLANARSUBGRAPH, sc)) {
        if (sc.getCurrent() == ELT_FASTPLANAR) {
          pgl->setSubgraph(new ogdf::FastPlanarSubgraph());
        }
        else {
          pgl->setSubgraph(new ogdf::MaximalPlanarSubgraphSimple());
        }
      }

      if (dataSet->get(ELT_EDGEINSERTION, sc)) {
        if (sc.getCurrent() == ELT_FIXEDEMBEDDING) {
          pgl->setInserter(new ogdf::FixedEmbeddingInserter());
        }
        else {
          pgl->setInserter(new ogdf::VariableEmbeddingInserter);
        }
      }
    }
  }
开发者ID:vadivelselvaraj,项目名称:TulipGLImprovement,代码行数:29,代码来源:OGDFPlanarizationGrid.cpp

示例5: Create

    GameAsset* Script::Create(StreamReader& reader, GameAsset* /*existingInstance*/)
    {
        const int length = reader.ReadInt();

        Buffer buffer;
        buffer.resize(length);

        reader.Read(&buffer[0], length);
        const int numberOfFunctions = reader.ReadInt();
        FunctionTable functionTable;
        functionTable.resize(numberOfFunctions);
        for (int i = 0; i < numberOfFunctions; i++)
        {
            Function& item = functionTable[i];
            item.Name = reader.ReadString();
            item.Position = reader.ReadInt();
            item.ArgumentStackSize = reader.ReadInt();
            item.ReturnTypes.resize(reader.ReadInt());
            for (std::vector<AnyType>::size_type i = 0; i < item.ReturnTypes.size(); i++)
                item.ReturnTypes[i] = static_cast<AnyType>(reader.ReadInt());
            item.ParameterTypes.resize(reader.ReadInt());
            for (std::vector<AnyType>::size_type i = 0; i < item.ParameterTypes.size(); i++)
                item.ParameterTypes[i] = static_cast<AnyType>(reader.ReadInt());
        }

        const int numberOfStrings = reader.ReadInt();
        StringCollection stringTable;
        stringTable.reserve(numberOfStrings);
        for (int i = 0; i < numberOfStrings; i++)
            stringTable.push_back(reader.ReadString());

        return new Script(buffer, functionTable, stringTable, MoveTag());
    }
开发者ID:Darkttd,项目名称:Bibim,代码行数:33,代码来源:Script.cpp

示例6:

void IXMLHandler::impl::startElement(const XMLCh * const uri, const XMLCh * const localname, const XMLCh* const qname, const xerces::Attributes &attrs)
{
    HandlerBase::startElement(uri, localname, qname, attrs);

    StringCollection<String> attributes;
    XMLSize_t count = attrs.getLength();
    for(XMLSize_t i = 0; i < count; i++)
    {
        attributes.set(attrs.getLocalName(i), attrs.getValue(i));
    }

    m_handler->onStartElement(localname, attributes);
}
开发者ID:,项目名称:,代码行数:13,代码来源:

示例7: _T

void TestDirectory::TestGetFilesWithMask()
{
	typedef std::vector<std::tstring> StringCollection;
	StringCollection fileNames = Workshare::System::IO::Directory::GetFiles(TEST_FOLDER + _T("\\TestGetFiles"), _T("*.doc"));
	assertEquals(2, (long)fileNames.size());

	// make all fileNames lowercase, so we can find them.
	std::for_each(fileNames.begin(), fileNames.end(), MakeFileNameLowerCase);

	StringCollection::iterator fileName = std::find(fileNames.begin(), fileNames.end(), tolower(TEST_FOLDER + _T("\\testgetfiles\\filea.doc")));
	assertMessage(fileName != fileNames.end(), _T("Expected to find [") + TEST_FOLDER + _T("\\testgetfiles\\filea.doc] in the returned list"));

	fileName = std::find(fileNames.begin(), fileNames.end(), tolower(TEST_FOLDER + _T("\\testgetfiles\\fileb.doc")));
	assertMessage(fileName != fileNames.end(), _T("Expected to find [") + TEST_FOLDER + _T("\\testgetfiles\\fileb.doc] in the returned list"));
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:15,代码来源:TestDirectory.cpp

示例8: FromClientId

bool TestMultiPackageHostContext::FromClientId(std::wstring const& clientId, TestMultiPackageHostContext & testMultiPackageHostContext)
{
    StringCollection collection;
    StringUtility::Split<wstring>(clientId, collection, TestMultiPackageHostContext::ParamDelimiter);
    if(collection.size() == 2)
    {
        Federation::NodeId nodeId;
        TestSession::FailTestIfNot(Federation::NodeId::TryParse(collection[0], nodeId), "Could not parse NodeId: {0}", clientId);
        testMultiPackageHostContext = TestMultiPackageHostContext(nodeId.ToString(), collection[1]);
        return true;
    }
    else
    {
        return false;
    }
}
开发者ID:vturecek,项目名称:Service-Fabric,代码行数:16,代码来源:TestMultiPackageHostContext.cpp

示例9:

vector<ServiceMetric> PlacementAndLoadBalancingUnitTest::CreateMetrics(wstring metrics)
{
    StringCollection metricCollection;
    StringUtility::Split<wstring>(metrics, metricCollection, ItemDelimiter);

    vector<ServiceMetric> metricList;
    for (wstring const& metricStr : metricCollection)
    {
        StringCollection metricProperties;
        StringUtility::Split<wstring>(metricStr, metricProperties, PairDelimiter);

        ASSERT_IFNOT(metricProperties.size() == 4, "Metric error");

        metricList.push_back(ServiceMetric(move(metricProperties[0]), Common::Double_Parse(metricProperties[1]), _wtoi(metricProperties[2].c_str()), _wtoi(metricProperties[3].c_str())));
    }

    return metricList;
}
开发者ID:vturecek,项目名称:Service-Fabric,代码行数:18,代码来源:TestUtility.cpp

示例10: AddSpecification

bool UnreliableTransportConfiguration::AddSpecification(std::wstring const & name, std::wstring const & data)
{
    StringCollection params;
    StringUtility::Split<wstring>(data, params, L" ");

    wstring source = (params.size() > 0 ? params[0] : wstring());
    wstring destination = (params.size() > 1 ? params[1] : wstring());
    wstring action = (params.size() > 2 ? params[2] : wstring());
    double probability = (params.size() > 3 ? Common::Double_Parse(params[3]) : 1.0);
    TimeSpan delay = (params.size() > 4 ? ParseTimeSpan(params[4]) : TimeSpan::MaxValue);
    TimeSpan delaySpan = (params.size() > 5 ? ParseTimeSpan(params[5]) : TimeSpan::Zero);
    int priority = (params.size() > 6 ? Common::Int32_Parse(params[6]) : 0);
    int applyCount = (params.size() > 7 ? Common::Int32_Parse(params[7]) : -1);

    return AddSpecification(make_unique<UnreliableTransportSpecification>(name, source, destination, action, probability, delay, delaySpan, priority, applyCount));
}
开发者ID:vturecek,项目名称:Service-Fabric,代码行数:16,代码来源:UnreliableTransportConfiguration.cpp

示例11: ApplicationCapacitiesDescription

map<wstring, ApplicationCapacitiesDescription> PlacementAndLoadBalancingUnitTest::CreateApplicationCapacities(wstring appCapacities)
{
    map<std::wstring, ApplicationCapacitiesDescription> capacityDesc;

    StringCollection capacityCollection;
    StringUtility::Split<wstring>(appCapacities, capacityCollection, ItemDelimiter);
    for (wstring const& metricStr : capacityCollection)
    {
        StringCollection metricProperties;
        StringUtility::Split<wstring>(metricStr, metricProperties, PairDelimiter);

        ASSERT_IFNOT(metricProperties.size() == 4, "CreateApplicationCapacities metric error");

        wstring metricName = metricProperties[0];
        capacityDesc.insert(make_pair(metricName,
            ApplicationCapacitiesDescription(move(metricProperties[0]), _wtoi(metricProperties[1].c_str()), _wtoi(metricProperties[2].c_str()), _wtoi(metricProperties[3].c_str()))));
    }

    return capacityDesc;
}
开发者ID:vturecek,项目名称:Service-Fabric,代码行数:20,代码来源:TestUtility.cpp

示例12: GetEthernetList

void GetEthernetList(StringCollection& dev)
{
    CommandModel cmd;
    cmd.FuncName = FuncEthernetGetAll;
    cmd.Password = true;
    Value result;
    Rpc::Call(cmd, result);
    ENUM_LIST(EthernetInterface, List<EthernetInterface>(result), e)
    {
        EthernetInterface eth(*e);
        dev.insert(eth.Dev);
    }
开发者ID:lushevol,项目名称:Kylin-LoadBalancer,代码行数:12,代码来源:parsergraph.cpp

示例13: beforeCall

  void beforeCall() {
    ogdf::TreeLayout *tree = static_cast<ogdf::TreeLayout*>(ogdfLayoutAlgo);

    if (dataSet != NULL) {
      double dval = 0;
      bool bval = false;
      StringCollection sc;

      if (dataSet->get("siblings distance", dval))
        tree->siblingDistance(dval);

      if (dataSet->get("subtrees distance", dval))
        tree->subtreeDistance(dval);

      if (dataSet->get("levels distance", dval))
        tree->levelDistance(dval);

      if (dataSet->get("trees distance", dval))
        tree->treeDistance(dval);

      if (dataSet->get("orthogonal layout", bval))
        tree->orthogonalLayout(bval);

      if (dataSet->get(ELT_ORIENTATION, sc)) {
        if (sc.getCurrent() == ELT_TOPTOBOTTOM) {
          tree->orientation(ogdf::topToBottom);
        }
        else if (sc.getCurrent() == ELT_BOTTOMTOTOP) {
          tree->orientation(ogdf::bottomToTop);
        }
        else if (sc.getCurrent() == ELT_LEFTTORIGHT) {
          tree->orientation(ogdf::leftToRight);
        }
        else {
          tree->orientation(ogdf::rightToLeft);
        }
      }

      if (dataSet->get(ELT_ROOTSELECTION, sc)) {
        if (sc.getCurrent() == ELT_ROOTSOURCE) {
          tree->rootSelection(ogdf::TreeLayout::rootIsSource);
        }
        else if (sc.getCurrent() == ELT_ROOTSINK) {
          tree->rootSelection(ogdf::TreeLayout::rootIsSink);
        }
        else {
          tree->rootSelection(ogdf::TreeLayout::rootByCoord);
        }
      }
    }
  }
开发者ID:vadivelselvaraj,项目名称:TulipGLImprovement,代码行数:51,代码来源:OGDFTree.cpp

示例14: beforeCall

  void beforeCall() {
    ogdf::SugiyamaLayout *sugiyama = static_cast<ogdf::SugiyamaLayout*>(ogdfLayoutAlgo);

    if (dataSet != NULL) {
      int ival = 0;
      double dval = 0;
      bool bval = false;
      StringCollection sc;

      if (dataSet->get("fails", ival))
        sugiyama->fails(ival);

      if (dataSet->get("runs", ival))
        sugiyama->runs(ival);

      if (dataSet->get("arrangeCCS", bval))
        sugiyama->arrangeCCs(bval);

      if (dataSet->get("minDistCC", dval))
        sugiyama->minDistCC(dval);

      if (dataSet->get("pageRatio", dval))
        sugiyama->pageRatio(dval);

      if (dataSet->get("alignBaseClasses", bval))
        sugiyama->alignBaseClasses(bval);

      if (dataSet->get("alignSiblings", bval))
        sugiyama->alignSiblings(bval);

      if (dataSet->get(ELT_RANKING, sc)) {
        if (sc.getCurrent() == ELT_LONGESTPATHRANKING) {
          sugiyama->setRanking(new ogdf::LongestPathRanking());
        }
        else if(sc.getCurrent() == ELT_OPTIMALRANKING) {
          sugiyama->setRanking(new ogdf::OptimalRanking());
        }
        else
          sugiyama->setRanking(new ogdf::CoffmanGrahamRanking());
      }

      if (dataSet->get(ELT_TWOLAYERCROSS, sc)) {
        if (sc.getCurrent() == ELT_BARYCENTER) {
          sugiyama->setCrossMin(new ogdf::BarycenterHeuristic());
        }
        else if (sc.getCurrent() == ELT_MEDIAN) {
          sugiyama->setCrossMin(new ogdf::MedianHeuristic());
        }
        else if(sc.getCurrent()==ELT_SPLIT) {
          sugiyama->setCrossMin(new ogdf::SplitHeuristic());
        }
        else if(sc.getCurrent()==ELT_SIFTING) {
          sugiyama->setCrossMin(new ogdf::SiftingHeuristic());
        }
        else if(sc.getCurrent()==ELT_GREEDYINSERT) {
          sugiyama->setCrossMin(new ogdf::GreedyInsertHeuristic());
        }
        else
          sugiyama->setCrossMin(new ogdf::GreedySwitchHeuristic());
      }

      if(dataSet->get(ELT_HIERARCHYLAYOUT, sc)) {
        double nodeDistance = 3;
        double layerDistance = 3;
        bool fixedLayerDistance = true;
        dataSet->get("node distance", nodeDistance);
        dataSet->get("layer distance", layerDistance);
        dataSet->get("fixed layer distance", fixedLayerDistance);

        if(sc.getCurrent()==ELT_FASTHIERARCHY) {
          ogdf::FastHierarchyLayout *fhl = new FastHierarchyLayout();
          fhl->nodeDistance(nodeDistance);
          fhl->layerDistance(layerDistance);
          fhl->fixedLayerDistance(fixedLayerDistance);
          sugiyama->setLayout(fhl);
        }
        else {
          sugiyama->setLayout(new ogdf::FastSimpleHierarchyLayout(static_cast<int>(nodeDistance), static_cast<int>(layerDistance)));
        }
      }
    }
  }
开发者ID:kdbanman,项目名称:browseRDF,代码行数:82,代码来源:OGDFSugiyama.cpp

示例15: setClassName

		StringCollection::StringCollection(const StringCollection &sc){
#ifdef USE_EMBEDDED_CLASSNAMES
			setClassName(__xvr2_Util_StringCollection);
#endif
			insert(begin(), sc.begin(), sc.end());
		}
开发者ID:coredumped,项目名称:X-VR2,代码行数:6,代码来源:StringCollection.cpp


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