本文整理汇总了C++中MakeString函数的典型用法代码示例。如果您正苦于以下问题:C++ MakeString函数的具体用法?C++ MakeString怎么用?C++ MakeString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MakeString函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: MakeString
void Application::onKey(int key, int scancode, int action, int mods) {
InputEvent& e = inputEvent;
e.type = InputType::Key;
e.action = action;
e.key = key;
e.scancode = scancode;
e.mods = mods;
e.cursor = context->cursorPosition;
if (key == GLFW_KEY_F11 && e.action == GLFW_PRESS) {
for (int i = 0; i < 1000; i++) {
std::string screenShot = MakeString() << GetDesktopDirectory()
<< ALY_PATH_SEPARATOR<<"screenshot"<<std::setw(4)<<std::setfill('0')<<i<<".png";
if(!FileExists(screenShot)) {
std::cout<<"Saving "<<screenShot<<std::endl;
ImageRGBA img;
getScreenShot(img);
FlipVertical(img);
WriteImageToFile(screenShot,img);
break;
}
}
}
fireEvent(e);
}
开发者ID:galek,项目名称:Alloy-Graphics-Library,代码行数:25,代码来源:AlloyApplication.cpp
示例17: MakeString
IAIMPString* AIMPCoreWrapper::LangGetValue(PWCHAR keyPath, int partIndex) {
IAIMPString* value;
if (SUCCEEDED(LangLoadString(keyPath, partIndex, &value))) {
return value;
}
return MakeString(L"");
}
开发者ID:alexesprit,项目名称:aimp_api_wrappers,代码行数:7,代码来源:AIMPCoreWrapper.cpp
示例18: GetDlgItem
//输入信息
void CDlgInsureGame::OnEnChangeInCount()
{
//状态效验
if(!m_pMeUserData) return;
//获取数据
CString strCount;
GetDlgItem(IDC_IN_COUNT)->GetWindowText(strCount);
//去掉前面的0
CString strLeft = strCount.Left(1);
if(strLeft.Find('0') != -1)
{
strCount = strCount.Right(strCount.GetLength() - 1);
SetDlgItemText(IDC_IN_COUNT,strCount);
}
//设置信息
SCORE lInCount=(m_bBankStorage)?m_lGameGold:m_lStorageGold;
MakeStringToNum(strCount, m_lInCount);
if((m_lInCount > lInCount || m_lInCount < 0L))
{
m_lInCount = lInCount;
CString strlGameGold;
MakeString(strlGameGold,m_lInCount);
SetDlgItemText(IDC_IN_COUNT,strlGameGold);
}
return ;
}
开发者ID:lonyzone,项目名称:oathx-ogrex-editor,代码行数:31,代码来源:DlgInsureGame.cpp
示例19: MakeString
void PS_ObjectDialog::PS_ObjectControl::SetControlFromObject()
{
char expandedName[80];
MakeString(expandedName, currObj->GetID(), "::", currObj->GetType(), 80);
objStatus.SetToggleText(expandedName);
objStatus.SetValue(currObj->doPlot);
}
开发者ID:jjayne,项目名称:nSIGHTS,代码行数:7,代码来源:PS_ObjectDialog.cpp
示例20: StrBeginIter
// Try to load the resource DLL from [each directory in %PATH%]/<lcid>/
static void *LoadSearchPath(const MyString &resourceDllName, LocalizedFileHandler lfh)
{
void *hmod = NULL;
// Get the PATH variable into a C++ string
MyString envPath;
if (ClrGetEnvironmentVariable("PATH", envPath))
return hmod;
MyStringIterator endOfChunk, startOfChunk = StrBeginIter(envPath);
MyString tryPath;
for (SkipChars(envPath, startOfChunk, W(' '), W(';'));
hmod == NULL && startOfChunk != StrEndIter(envPath);
SkipChars(envPath, startOfChunk, W(' '), W(';')))
{
// copy this chunk of the path into our trypath
endOfChunk = startOfChunk;
FindNext(envPath, endOfChunk, W(';'));
MakeString(tryPath, envPath, startOfChunk, endOfChunk);
// Don't try invalid locations
if (IsEmptyStr(tryPath) || CharLength(tryPath) >= _MAX_PATH)
continue;
// Try to load the dll
hmod = LoadLocalFile(tryPath, resourceDllName, lfh);
startOfChunk = endOfChunk;
}
return hmod;
}
开发者ID:0-wiz-0,项目名称:coreclr,代码行数:32,代码来源:loadrc-impl.cpp
注:本文中的MakeString函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论