本文整理汇总了C++中AString::Trim方法的典型用法代码示例。如果您正苦于以下问题:C++ AString::Trim方法的具体用法?C++ AString::Trim怎么用?C++ AString::Trim使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AString
的用法示例。
在下文中一共展示了AString::Trim方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ScanUserYesNoAllQuit
NUserAnswerMode::EEnum ScanUserYesNoAllQuit(CStdOutStream *outStream)
{
(*outStream) << kFirstQuestionMessage;
for (;;)
{
(*outStream) << kHelpQuestionMessage;
outStream->Flush();
AString scannedString = g_StdIn.ScanStringUntilNewLine();
scannedString.Trim();
if (!scannedString.IsEmpty())
switch(
::MyCharUpper(
#ifdef UNDER_CE
(wchar_t)
#endif
scannedString[0]))
{
case kYes:
return NUserAnswerMode::kYes;
case kNo:
return NUserAnswerMode::kNo;
case kYesAll:
return NUserAnswerMode::kYesAll;
case kNoAll:
return NUserAnswerMode::kNoAll;
case kAutoRenameAll:
return NUserAnswerMode::kAutoRenameAll;
case kQuit:
return NUserAnswerMode::kQuit;
}
}
}
示例2: ScanUserYesNoAllQuit
NUserAnswerMode::EEnum ScanUserYesNoAllQuit(CStdOutStream *outStream)
{
if (outStream)
*outStream << kFirstQuestionMessage;
for (;;)
{
if (outStream)
{
*outStream << kHelpQuestionMessage;
outStream->Flush();
}
AString scannedString = g_StdIn.ScanStringUntilNewLine();
scannedString.Trim();
if (!scannedString.IsEmpty())
switch (::MyCharLower_Ascii(scannedString[0]))
{
case kYes: return NUserAnswerMode::kYes;
case kNo: return NUserAnswerMode::kNo;
case kYesAll: return NUserAnswerMode::kYesAll;
case kNoAll: return NUserAnswerMode::kNoAll;
case kAutoRenameAll: return NUserAnswerMode::kAutoRenameAll;
case kQuit: return NUserAnswerMode::kQuit;
}
}
}
示例3: CompressFiles
//.........这里部分代码省略.........
{ DI_SINGLEBOX, kXMid, 4, 70, 4 + 5, false, false, 0, false, NMessageID::kUpdateMode, NULL, NULL },
{ DI_RADIOBUTTON, kXMid + 2, 5, 0, 0, false,
actionSet == &kAddActionSet,
DIF_GROUP, false, NMessageID::kUpdateModeAdd, NULL, NULL },
{ DI_RADIOBUTTON, kXMid + 2, 6, 0, 0, false,
actionSet == &kUpdateActionSet,
0, false, NMessageID::kUpdateModeUpdate, NULL, NULL },
{ DI_RADIOBUTTON, kXMid + 2, 7, 0, 0, false,
actionSet == &kFreshActionSet,
0, false, NMessageID::kUpdateModeFreshen, NULL, NULL },
{ DI_RADIOBUTTON, kXMid + 2, 8, 0, 0, false,
actionSet == &kSynchronizeActionSet,
0, false, NMessageID::kUpdateModeSynchronize, NULL, NULL },
{ DI_TEXT, 3, kYSize - 4, 0, 0, false, false, DIF_BOXCOLOR|DIF_SEPARATOR, false, -1, "", NULL },
{ DI_BUTTON, 0, kYSize - 3, 0, 0, false, false, DIF_CENTERGROUP, true, NMessageID::kUpdateAdd, NULL, NULL },
{ DI_BUTTON, 0, kYSize - 3, 0, 0, false, false, DIF_CENTERGROUP, false, NMessageID::kUpdateSelectArchiver, NULL, NULL },
{ DI_BUTTON, 0, kYSize - 3, 0, 0, false, false, DIF_CENTERGROUP, false, NMessageID::kCancel, NULL, NULL }
};
const int kNumDialogItems = sizeof(initItems) / sizeof(initItems[0]);
const int kOkButtonIndex = kNumDialogItems - 3;
const int kSelectarchiverButtonIndex = kNumDialogItems - 2;
FarDialogItem dialogItems[kNumDialogItems];
g_StartupInfo.InitDialogItems(initItems, dialogItems, kNumDialogItems);
int askCode = g_StartupInfo.ShowDialog(76, kYSize,
kHelpTopic, dialogItems, kNumDialogItems);
archiveNameA = dialogItems[kArchiveNameIndex].Data;
archiveNameA.Trim();
archiveName = MultiByteToUnicodeString(archiveNameA, CP_OEMCP);
compressionInfo.Level = g_MethodMap[0];
for (i = 0; i < sizeof(g_MethodMap)/ sizeof(g_MethodMap[0]); i++)
if (dialogItems[kMethodRadioIndex + i].Selected)
compressionInfo.Level = g_MethodMap[i];
if (dialogItems[kModeRadioIndex].Selected)
actionSet = &kAddActionSet;
else if (dialogItems[kModeRadioIndex + 1].Selected)
actionSet = &kUpdateActionSet;
else if (dialogItems[kModeRadioIndex + 2].Selected)
actionSet = &kFreshActionSet;
else if (dialogItems[kModeRadioIndex + 3].Selected)
actionSet = &kSynchronizeActionSet;
else
throw 51751;
if (askCode == kSelectarchiverButtonIndex)
{
CIntVector indices;
CSysStringVector archiverNames;
for (int i = 0; i < codecs->Formats.Size(); i++)
{
const CArcInfoEx &arc = codecs->Formats[i];
if (arc.UpdateEnabled)
{
indices.Add(i);
archiverNames.Add(GetSystemString(arc.Name, CP_OEMCP));
}
}