Пример #1
0
static std::string  GenerateClonedBranchName
                                      (const P3DPlantModel     *PlantModel,
                                       const P3DBranchModel    *SourceBranchModel)
 {
  std::string Prefix = SourceBranchModel == PlantModel->GetPlantBase() ?
                        "Branch" : SourceBranchModel->GetName();
  std::string Result;

  Prefix += '-';

  bool         Done  = false;
  unsigned int Index = 0;

  while (!Done && ++Index < 1000)
   {
    std::ostringstream ResultStream(Prefix,std::ios_base::app);

    ResultStream << Index;

    Result = ResultStream.str();

    Done = P3DPlantModel::GetBranchModelByName
            ((P3DPlantModel*)PlantModel,Result.c_str()) == 0;
   }

  if (!Done)
   {
    Result = Prefix + "?";
   }

  return Result;
 }
Пример #2
0
 std::string dispatch(std::vector<std::string> const &Args,
                      seec::ct::sequence_int<ArgIs...>) const
 {
   std::string Result;
   llvm::raw_string_ostream ResultStream(Result);
   
   CallbackFn(ParseImpl<ArgTs>::impl(Args[ArgIs])...);
   FormatImpl<void>::impl(ResultStream);
   
   ResultStream.flush();
   return Result;
 }
Пример #3
0
 std::string dispatch(std::vector<std::string> const &Args,
                      seec::ct::sequence_int<ArgIs...>) const
 {
   std::string Result;
   llvm::raw_string_ostream ResultStream(Result);
   
   FormatImpl<typename std::remove_reference<ResultT>::type>
     ::impl(ResultStream, CallbackFn(ParseImpl<ArgTs>::impl(Args[ArgIs])...));
   
   ResultStream.flush();
   return Result;
 }