本文整理汇总了C++中ErrorList::AsString方法的典型用法代码示例。如果您正苦于以下问题:C++ ErrorList::AsString方法的具体用法?C++ ErrorList::AsString怎么用?C++ ErrorList::AsString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ErrorList
的用法示例。
在下文中一共展示了ErrorList::AsString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TemplateWindow
//.........这里部分代码省略.........
sWindowCount++;
break;
}
case M_DEREGISTER_WINDOW:
{
sWindowCount--;
if (sWindowCount <= 1)
PostMessage(B_QUIT_REQUESTED);
break;
}
case EDIT_OPEN_FILE:
{
int32 index = 0;
entry_ref ref;
while (msg->FindRef("refs",index,&ref) == B_OK)
{
int32 line;
if (msg->FindInt32("line",index,&line) != B_OK)
line = -1;
int32 column;
if (msg->FindInt32("column",index,&column) != B_OK)
column = -1;
OpenFile(ref,line,column);
index++;
}
CheckCreateOpenPanel();
fOpenPanel->GetPanelDirectory(&ref);
gLastProjectPath.SetTo(ref);
BWindow* openWindow = fOpenPanel->Window();
break;
}
case M_FIND_AND_OPEN_FILE:
{
FindAndOpenFile(msg);
break;
}
case M_BUILDING_FILE:
{
SourceFile *file;
if (msg->FindPointer("sourcefile",(void**)&file) == B_OK)
printf(B_TRANSLATE("Building %s\n"),file->GetPath().GetFileName());
else
printf(B_TRANSLATE("NULL pointer in M_BUILDING_FILE\n"));
break;
}
case M_LINKING_PROJECT:
{
printf(B_TRANSLATE("Linking\n"));
break;
}
case M_UPDATING_RESOURCES:
{
printf(B_TRANSLATE("Updating resources\n"));
break;
}
case M_BUILD_FAILURE:
{
BString errstr;
if (msg->FindString("errstr",&errstr) == B_OK)
printf("%s\n",errstr.String());
else
{
ErrorList errors;
errors.Unflatten(*msg);
printf(B_TRANSLATE("Build failure\n%s"), errors.AsString().String());
}
sReturnCode = -1;
PostMessage(B_QUIT_REQUESTED);
break;
}
case M_BUILD_WARNINGS:
{
BString errstr;
if (msg->FindString("errstr",&errstr) == B_OK)
printf("%s\n",errstr.String());
break;
}
case M_BUILD_SUCCESS:
{
printf(B_TRANSLATE("Success\n"));
PostMessage(B_QUIT_REQUESTED);
break;
}
default:
BApplication::MessageReceived(msg);
}
}