本文整理汇总了C++中ErrorList::Unflatten方法的典型用法代码示例。如果您正苦于以下问题:C++ ErrorList::Unflatten方法的具体用法?C++ ErrorList::Unflatten怎么用?C++ ErrorList::Unflatten使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ErrorList
的用法示例。
在下文中一共展示了ErrorList::Unflatten方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: entry
void
ErrorWindow::MessageReceived(BMessage* message)
{
switch (message->what) {
case M_RUN_PROJECT:
case M_RUN_IN_TERMINAL:
case M_RUN_IN_DEBUGGER:
case M_RUN_WITH_ARGS:
case M_MAKE_PROJECT:
case M_FORCE_REBUILD:
{
fParent->PostMessage(message);
break;
}
case M_TOGGLE_ERRORS:
case M_TOGGLE_WARNINGS:
{
RefreshList();
break;
}
case M_COPY_ERRORS:
{
CopyList();
break;
}
case M_CLEAR_ERROR_LIST:
{
EmptyList();
fErrors.msglist.MakeEmpty();
break;
}
case M_BUILD_WARNINGS:
case M_BUILD_FAILURE:
{
ErrorList list;
list.Unflatten(*message);
AppendToList(list);
break;
}
case M_JUMP_TO_MSG:
{
int32 selection = fErrorList->CurrentSelection();
if (selection >= 0) {
ErrorItem* item = (ErrorItem*)fErrorList->ItemAt(selection);
error_msg* gcc = item->GetMessage();
if (gcc->path.Length() < 1)
break;
entry_ref ref;
BEntry entry(gcc->path.String());
entry.GetRef(&ref);
message->what = EDIT_OPEN_FILE;
message->AddRef("refs", &ref);
if (gcc->line > 0)
message->AddInt32("line", gcc->line);
be_app->PostMessage(message);
}
break;
}
default:
BWindow::MessageReceived(message);
}
}
示例2: 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);
}
}
示例3: openmsg
//.........这里部分代码省略.........
fProjectList->InvalidateItem(fProjectList->IndexOf(item));
}
}
break;
}
case M_LINKING_PROJECT:
{
fStatusBar->SetText(TR("Linking"));
break;
}
case M_UPDATING_RESOURCES:
{
fStatusBar->SetText(TR("Updating Resources"));
break;
}
case M_DOING_POSTBUILD:
{
fStatusBar->SetText(TR("Performing Post-build tasks"));
break;
}
case M_BUILD_FAILURE:
{
SetMenuLock(false);
// fall through
}
case M_BUILD_MESSAGES:
case M_BUILD_WARNINGS:
{
if (!fErrorWindow)
{
BRect screen(BScreen().Frame());
BRect r(screen);
r.left = r.right / 4.0;
r.right *= .75;
r.top = r.bottom - 200;
BDeskbar deskbar;
if (deskbar.Location() == B_DESKBAR_BOTTOM)
r.OffsetBy(0,-deskbar.Frame().Height());
fErrorWindow = new ErrorWindow(r,this);
fErrorWindow->Show();
}
else
{
if (!fErrorWindow->IsFront())
fErrorWindow->Activate();
}
fStatusBar->SetText("");
// Should this be an Unflatten or an Append?
ErrorList *errorList = fProject->GetErrorList();
errorList->Unflatten(*msg);
fErrorWindow->PostMessage(msg);
break;
}
case M_BUILD_SUCCESS:
{
SetMenuLock(false);
fStatusBar->SetText("");
break;
}
case M_ERRORWIN_CLOSED:
{
fErrorWindow = NULL;
break;
}
case M_SYNC_MODULES:
{
#ifdef BUILD_CODE_LIBRARY
thread_id syncID = spawn_thread(SyncThread,"module update thread",
B_NORMAL_PRIORITY, this);
if (syncID >= 0)
resume_thread(syncID);
#endif
break;
}
case M_TOGGLE_DEBUG_MENU:
{
ToggleDebugMenu();
break;
}
case M_DEBUG_DUMP_DEPENDENCIES:
{
DumpDependencies(fProject);
break;
}
case M_DEBUG_DUMP_INCLUDES:
{
DumpIncludes(fProject);
break;
}
default:
{
DWindow::MessageReceived(msg);
break;
}
}
}