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


C++ MakeString函数代码示例

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


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

示例1: HdlrFunc4

/* handler for function 4 */
static Obj  HdlrFunc4 (
 Obj  self,
 Obj  a_a )
{
 Obj t_1 = 0;
 Obj t_2 = 0;
 Obj t_3 = 0;
 Bag oldFrame;
 
 /* allocate new stack frame */
 SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);
 
 /* Print( "f3:", a, "\n" ); */
 t_1 = GF_Print;
 t_2 = MakeString( "f3:" );
 t_3 = MakeString( "\n" );
 CALL_3ARGS( t_1, t_2, a_a, t_3 );
 
 /* return; */
 SWITCH_TO_OLD_FRAME(oldFrame);
 return 0;
 
 /* return; */
 SWITCH_TO_OLD_FRAME(oldFrame);
 return 0;
}
开发者ID:dimpase,项目名称:gap,代码行数:27,代码来源:function_types.g.static.c

示例2: MakeImageDescriptor

/* Constructor  */ 
ImageDescriptor* MakeImageDescriptor (Integer naxis, Integer *dims) 
{ 
  Integer i; 
  ImageDescriptor *this;
  this = (ImageDescriptor *) malloc (sizeof(ImageDescriptor)); 
  this->image_name = MakeString("anon    "); 
  this->date_obs = MakeString("01/01/01"); 
  this->units = MakeString("Unknown "); 
  this->num_axes = naxis; 
  this->epoch=0.0; 
  this->equinox=0.0; 
  this->usr_equinox = -1.0; 
  for (i = 0; i < naxis; i++) this->axisdesc[i] = MakeAxisDescriptor(); 
/* DSS stuff */
  this->plate_label = MakeString("Not DSS "); 
  this->isDSS = 0;
  this->plate_RA = 0.0;
  this->plate_DEC = 0.0;
  this->plate_scale = 0.0;
  this->corn_pixel[0] = 0.0;
  this->corn_pixel[1] = 0.0;
  this->pixel_size[0] = 0.0;
  this->pixel_size[1] = 0.0;
  for (i=0; i<6; i++)   this->PPO[i] = 0.0;
  for (i=0; i<20; i++)  this->AMDX[i] = 0.0;
  for (i=0; i<20; i++)  this->AMDY[i] = 0.0;
  return this; 
} /* end MakeImageDescriptor */ 
开发者ID:OS2World,项目名称:APP-SCIENCE-Xfitsview,代码行数:29,代码来源:imagdesc.old.c

示例3: switch

std::string Game::get_no_money()
{
    std::string ret = "";
    switch (NMreason)
    {
        case ForTrade:
            ret = "\nУ вас не хватает денег чтобы оплатить покупку!";
            next_stage = ChooseGoods;
            break;
        case ForCaravane:
            ret = MakeString() << "\nУ Вас столько нету. Вы можете отправить от 0 до " << state.money << " руб.";
            if (random(100) < 25)
            {
                next_stage = EquipCaravane;
                break;
            }
            next_stage = RobCaravane;
            break;
        case ForTemple:
            ret = MakeString() << "\nУ Вас столько нету. Вы можете пожертвовать от 0 до " << state.money << " руб.";
            next_stage = RequestMetropolitan;
            break;
        default:
            break;
    }
    return ret;
}
开发者ID:niimailtah,项目名称:Euphoria,代码行数:27,代码来源:engine.cpp

示例4: while

sInt DebugInfo::GetNameSpaceByName(sChar *name)
{
  sChar *pp = name - 2;
  sChar *p;
  sInt cname;

  while((p = sFindString(pp+2,"::")))
    pp = p;

  while((p = sFindString(pp+1,".")))
    pp = p;

  if(pp != name - 2)
  {
    sChar buffer[2048];
    sCopyString(buffer,name,2048);

    if(pp - name < 2048)
      buffer[pp - name] = 0;

    cname = MakeString(buffer);
  }
  else
    cname = MakeString("<global>");

  return GetNameSpace(cname);
}
开发者ID:Ambrevar,项目名称:fr_public,代码行数:27,代码来源:debuginfo.cpp

示例5: GetDlgItem

//输入信息
void CDlgBank::OnEnChangeInCount()
{
	CString strInCount;
	CString strStorageGold;
	CString strGameGold;
	GetDlgItem(IDC_IN_COUNT)->GetWindowText(strInCount);
	MakeStringToNum(strInCount, m_lInCount);
	MakeString(strStorageGold, m_lStorageGold);
	MakeString(strGameGold, m_lGameGold);

	//参数验证
	if (false==m_bBankStorage && (m_lInCount < 0 || m_lInCount > m_lStorageGold || strInCount.GetLength() > strStorageGold.GetLength()) )
	{
		m_lInCount = m_lStorageGold;
		MakeString(strInCount,m_lInCount);
		GetDlgItem(IDC_IN_COUNT)->SetWindowText(strInCount);
	}

	//参数验证
	if (true==m_bBankStorage && (m_lInCount < 0 || m_lInCount > m_lGameGold || strInCount.GetLength() > strGameGold.GetLength()) )
	{
		m_lInCount = m_lGameGold;
		MakeString(strInCount,m_lInCount);
		GetDlgItem(IDC_IN_COUNT)->SetWindowText(strInCount);
	}

	return ;
}
开发者ID:anyboo,项目名称:project,代码行数:29,代码来源:DlgBank.cpp

示例6: HdlrFunc5

/* handler for function 5 */
static Obj  HdlrFunc5 (
 Obj  self,
 Obj  args )
{
 Obj  a_a;
 Obj  a_b;
 Obj t_1 = 0;
 Obj t_2 = 0;
 Obj t_3 = 0;
 Obj t_4 = 0;
 Bag oldFrame;
 CHECK_NR_AT_LEAST_ARGS( 2, args )
 a_a = ELM_PLIST( args, 1 );
 Obj x_temp_range = Range2Check(INTOBJ_INT(2), INTOBJ_INT(LEN_PLIST(args)));
 a_b = ELMS_LIST(args , x_temp_range);
 
 /* allocate new stack frame */
 SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);
 
 /* Print( "f4:", a, ":", b, "\n" ); */
 t_1 = GF_Print;
 t_2 = MakeString( "f4:" );
 t_3 = MakeString( ":" );
 t_4 = MakeString( "\n" );
 CALL_5ARGS( t_1, t_2, a_a, t_3, a_b, t_4 );
 
 /* return; */
 SWITCH_TO_OLD_FRAME(oldFrame);
 return 0;
 
 /* return; */
 SWITCH_TO_OLD_FRAME(oldFrame);
 return 0;
}
开发者ID:dimpase,项目名称:gap,代码行数:35,代码来源:function_types.g.static.c

示例7: fprintf

/* ========================================================================= */
struct options *init_options(void)
{
   struct options *o;
   char *bbhelpdir;

   if ( NULL == ( o = (struct options *)malloc(sizeof(struct options))) )
   {
      fprintf(stderr, "ERROR: Unable to allocate memory for options info.\n");
      return(NULL);
   }

   o->bDumpTemplate = 0;
   o->bVersion = 0;
   o->bCompile = 0;
   o->bDecompile = 0;
   o->iHelp = 0;
   o->bDebug = 0;
   o->bError = 0;
   o->iImpact = IMPACT_UNSET;
   o->bForceSrc = 0;
   o->qList = LIST_NONE;
   o->tooldump = NULL;
   o->keycons = NULL;

   if ( NULL == ( bbhelpdir = getenv("BBHELPDIR") ) )
      o->bbhelpdir = MakeString(DEFAULT_BBHELPDIR);
   else
      o->bbhelpdir = MakeString(bbhelpdir);

   o->systype = MakeUCString(DEFAULT_SYSTYPE);

   return(o);
}
开发者ID:bochf,项目名称:testing,代码行数:34,代码来源:options.c

示例8: operator

 std::string operator ()(const std::string &s)
 {
     std::size_t curr = start;
     for(std::string::size_type i = 0; i < s.size(); ++i)
     {
         if(!checkEdge(curr, s[i]))
             return MakeString() << "0" << "\n" << i << "\n" << GET_STR(curr);
         curr = M[curr][s[i]];
     }
     return MakeString() << (S.count(curr) ? "1" : "0") << "\n" << s.size() << "\n" << GET_STR(curr);
 }
开发者ID:bagnikita,项目名称:pract,代码行数:11,代码来源:ps07-3.cpp

示例9: CopyString

void DC_DateTime::TimeToString(char*    timeStr, int maxLen,
                               TimeFormat tf) const
{
    if (!TimeOK())
    {
        CopyString(timeStr, nullStr, maxLen);
        return;
    }

    char secStr[5], minStr[5], hrStr[5];
    IntToString(second, secStr, 2, 5);
    IntToString(minute, minStr, 2, 5);

    bool doAMPM = (tf == tfHHMMSSAP) || (tf == tfHHMMAP);
    if (doAMPM)
    {
        if (hour > 12)
            IntToString(hour - 12, hrStr, 5);
        else if (hour > 0)
            IntToString(hour, hrStr, 5);
        else
            CopyString(hrStr, "12", 5);
    }
    else
        IntToString(hour, hrStr, 2, 5);

    switch (tf)
    {
    case tfHHMMSS24:
    case tfHHMMSSAP: {
        MakeString(timeStr, hrStr, ":", minStr, ":", secStr, maxLen);
        break;
    }
    case tfHHMM24:
    case tfHHMMAP:  {
        MakeString(timeStr, hrStr, ":", minStr, maxLen);
        break;
    }
    case tfMMSS: {
        MakeString(timeStr, minStr, ":", secStr, maxLen);
        break;
    }
    }

    if (doAMPM)
    {
        if (hour > 11)
            ConcatString(timeStr, " PM", maxLen);
        else
            ConcatString(timeStr, " AM", maxLen);
    }


}
开发者ID:nsights,项目名称:nSIGHTS,代码行数:54,代码来源:DC_DateTime.cpp

示例10: IntToString

void PFO_2DMultTablesGL::ReportCursorData(const Coord3D& cursorPos)
{
    if ((! doPlot) || (!cursorReport->showReport) || (objStatus != os_OK))
    {
        //  unmanage if set up
        cursorReport->ReportTitleSetup(GetID());
        return;
    }

    int dataIndx;
    if (!cursorTrackData.GetClosestIndex(cursorPos.cX, cursorPos.cY, dataIndx))
        return;

    if (!cursorReport->reportInitialized)
    {
        cursorReport->ReportInit("#/X:");
        cursorReport->ReportTitleSetup(GetID());
        cursorReport->ReportLabelSetup(0, "#/X:");
        cursorReport->ReportLabelSetup(1, "#/Y:");
    }

    const SC_RealFormat& xForm = static_cast<PD_2D*>(assocPlot)->GetXFormat();
    const SC_RealFormat& yForm = static_cast<PD_2D*>(assocPlot)->GetYFormat();

    char intStr[40];
    char realStr[40];
    char outStr[80];
    for (int i = 0; i < maxTableSeries; i++)
        if (tableSeries[i].OKtoPlot())
        {
            const SC_DoubleMatrix& currData = tableSeries[i].tableDataDC->dataTable;
            const SC_DoubleArray& xData = currData[tableSeries[i].xColumn];
            if (dataIndx < xData.Size())
            {
                IntToString(dataIndx, intStr, 40);
                xForm.RealToString(xData[dataIndx], realStr, 40);
                MakeString(outStr, intStr, "/", realStr, 80);
                cursorReport->ReportUpdate(0, outStr);

                IntToString(i, intStr, 40);
                yForm.RealToString(currData[tableSeries[i].yColumn][dataIndx], realStr, 40);
                MakeString(outStr, intStr, "/", realStr, 80);
                cursorReport->ReportUpdate(1, outStr);
                return;
            }
            dataIndx -= xData.Size();
        }

}
开发者ID:jjayne,项目名称:nSIGHTS,代码行数:49,代码来源:PFO_2DMultTablesGL.cpp

示例11: printf

std::string Game::get_state() //long god)
{
    std::string ret;

/*    if (fl_end == 1)
    {
        printf("---------------------------------------------------------------------------------\n");
        printf("                   Состояние Ваших дел после %li лет правления.", god);
    }
    else
    {
*/
    ret = MakeString() << "---------------------------------------------------------------------------------\n"
        << "                   Состояние Ваших дел на " << state.cur_year << "-й год правления."
//    }
        << "\nНаличность в казне: " << state.money << " руб."
        << "\n╔════════════════╤════════════╗"
        << "\n║    Название    │   Запасы   ║"
        << "\n╠════════════════╪════════════╣"
        << "\n║ Золото, кг     │ " << std::setw(10) << state.gold  << " ║"
        << "\n║ Земля, га      │ " << std::setw(10) << state.land  << " ║"
        << "\n║ Зерно, тонн    │ " << std::setw(10) << state.grain << " ║"
        << "\n║ Крестьяне, душ │ " << std::setw(10) << state.peasant << " ║"
        << "\n║ Гвардия, чел.  │ " << std::setw(10) << state.guard << " ║"
        << "\n╚════════════════╧════════════╝\n";
    return ret;
/*    if (MENTOR)
    {
        long int difference = cur_guard * 3 + cur_krest * 3 +cur_land;
        printf("\nНадо %li зерна\nМожно продать %li", difference, cur_zerno - difference);
    }*/
}
开发者ID:niimailtah,项目名称:Euphoria,代码行数:32,代码来源:engine.cpp

示例12: MakeInvocation

static FObject MakeInvocation(int argc, FChS * argv[])
{
    uint_t sl = -1;

    for (int adx = 0; adx < argc; adx++)
        sl += StringLengthS(argv[adx]) + 1;

    FObject s = MakeString(0, sl);
    uint_t sdx = 0;

    for (int adx = 0; adx < argc; adx++)
    {
        sl = StringLengthS(argv[adx]);
        for (uint_t idx = 0; idx < sl; idx++)
        {
            AsString(s)->String[sdx] = argv[adx][idx];
            sdx += 1;
        }

        if (adx + 1 < argc)
        {
            AsString(s)->String[sdx] = ' ';
            sdx += 1;
        }
    }

    return(s);
}
开发者ID:beimprovised,项目名称:foment,代码行数:28,代码来源:main.cpp

示例13: DXCall

void SwapChain::AfterReset()
{
    // Re-create an RTV for each back buffer
    for(uint64 i = 0; i < NumBackBuffers; i++)
    {
        backBuffers[i].RTV = DX12::RTVDescriptorHeap.AllocatePersistent().Handles[0];
        DXCall(swapChain->GetBuffer(uint32(i), IID_PPV_ARGS(&backBuffers[i].Texture.Resource)));

        D3D12_RENDER_TARGET_VIEW_DESC rtvDesc = { };
        rtvDesc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2D;
        rtvDesc.Format = format;
        rtvDesc.Texture2D.MipSlice = 0;
        rtvDesc.Texture2D.PlaneSlice = 0;
        DX12::Device->CreateRenderTargetView(backBuffers[i].Texture.Resource, &rtvDesc, backBuffers[i].RTV);

        backBuffers[i].Texture.Resource->SetName(MakeString(L"Back Buffer %llu", i).c_str());

        backBuffers[i].Texture.Width = width;
        backBuffers[i].Texture.Height = height;
        backBuffers[i].Texture.ArraySize = 1;
        backBuffers[i].Texture.Format = format;
        backBuffers[i].Texture.NumMips = 1;
        backBuffers[i].MSAASamples = 1;
    }

    backBufferIdx = swapChain->GetCurrentBackBufferIndex();
}
开发者ID:TheRealMJP,项目名称:DeferredTexturing,代码行数:27,代码来源:SwapChain.cpp

示例14: IntToString

void SuperComponent::SetID(const char* inDesig,
                           int   index)
{
  char tempStr[20];
  IntToString(index + 1, tempStr, 20);
  MakeString(rID, inDesig, "[", tempStr, "]", componentIDLen);
}
开发者ID:nsights,项目名称:nSIGHTS,代码行数:7,代码来源:C_DataCapture.cpp

示例15: KillTimer

void CProgressThreadDlg::SetFinished()
{
  if (m_uTimerID != 0) {
    KillTimer(m_uTimerID);
  }

  // update button
  CWnd* pWnd = GetDlgItem(IDC_CANCEL);
  ASSERT(pWnd);
  pWnd->SetWindowText("OK");

  char endTitle[80];
  MakeString(endTitle, m_sCaption, " Completed", 80);
  ChangeTitle(endTitle);

  // progress bar to end
  SetProgressStep(m_nSteps);

  // final time label
  pWnd = GetDlgItem(IDC_ELAPSED_TIME);
  ASSERT(pWnd);
  m_timeEnd = CTime::GetCurrentTime();
  CTimeSpan ts = m_timeEnd - m_timeStart;
  CString sText = ts.Format("Total elapsed time  %H:%M:%S");
  pWnd->SetWindowText(sText);

  m_bOkToClose = true;
}
开发者ID:nsights,项目名称:nSIGHTS,代码行数:28,代码来源:ProgressThreadDlg.cpp


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