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


C++ JError类代码示例

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


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

示例1: JExecute

void
SVNInfoLog::Execute
	(
	const JCharacter* cmd
	)
{
	(JXGetApplication())->DisplayBusyCursor();

	pid_t pid;
	int outFD, errFD;
	JError err = JExecute(cmd, &pid,
						  kJIgnoreConnection, NULL,
						  kJCreatePipe, &outFD,
						  kJCreatePipe, &errFD);
	if (!err.OK())
		{
		err.ReportIfError();
		return;
		}

	const JFontStyle red(kJTrue, kJFalse, 0, kJFalse, (GetColormap())->GetRedColor());

	JString text;
	JReadAll(errFD, &text);
	SetCurrentFontStyle(red);
	Paste(text);

	JReadAll(outFD, &text);
	SetCurrentFontStyle(JFontStyle());
	Paste(text);
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:31,代码来源:SVNInfoLog.cpp

示例2: JCreateTempFile

void
GMMIMEParser::WriteAttachment
	(
	const JString&		data,
	const GMIMEHeader&	header
	)
{
	JString filename = header.GetFileName();
	if (filename.IsEmpty())
		{
		const JError err = JCreateTempFile(itsAttachDir, NULL, &filename);
		if (!err.OK())
			{
			err.ReportIfError();
			return;
			}
		}
	else
		{
		filename = JCombinePathAndName(itsAttachDir, filename);
		}

	AdjustAttachmentName(header, &filename);
	std::ofstream os(filename);
	if (header.GetEncoding() == kBase64Encoding)
		{
		std::istrstream is(data.GetCString(), data.GetLength());
		JDecodeBase64(is, os);
		}
	else
		{
		data.Print(os);
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:34,代码来源:GMMIMEParser.cpp

示例3: GetText

void
JXFLInputBase::Receive
	(
	JBroadcaster*	sender,
	const Message&	message
	)
{
	if (sender == itsHistoryMenu && message.Is(JXMenu::kItemSelected))
		{
		const JString origStr = GetText();
		const JString newStr  = itsHistoryMenu->GetItemText(message);
		SetText(newStr);

		const JError err = Apply();
		if (err.OK())
			{
			itsHistoryMenu->AddString(newStr);
			}
		else
			{
			SetText(origStr);
			err.ReportIfError();
			}
		}

	else
		{
		JXInputField::Receive(sender, message);
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:30,代码来源:JXFLInputBase.cpp

示例4: assert

JBoolean
GFGLink::StartCTags()
{
	assert( itsCTagsProcess == NULL );

	JString cmd = kCTagsCmd;

	int toFD, fromFD;
	const JError err = JProcess::Create(&itsCTagsProcess, cmd,
										kJCreatePipe, &toFD,
										kJCreatePipe, &fromFD,
										kJAttachToFromFD, NULL);
	if (err.OK())
		{
		itsOutputLink = jnew JOutPipeStream(toFD, kJTrue);
		assert( itsOutputLink != NULL );

		itsInputFD = fromFD;
		assert( itsInputFD != ACE_INVALID_HANDLE );

		ListenTo(itsCTagsProcess);

		return kJTrue;
		}
	else
		{
		(JGetStringManager())->ReportError(kUnableToStartCTagsID, err);
		return kJFalse;
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:30,代码来源:GFGLink.cpp

示例5: JXDialogDirector

CMChooseProcessDialog::CMChooseProcessDialog
	(
	JXDirector*		supervisor,
	const JBoolean	attachToSelection,
	const JBoolean	stopProgram
	)
	:
	JXDialogDirector(supervisor, kJTrue),
	itsAttachToSelectionFlag(attachToSelection),
	itsStopProgramFlag(stopProgram)
{
	BuildWindow();

	int inFD;
	const JError err = JExecute(kCmdStr, NULL,
								kJIgnoreConnection, NULL,
								kJCreatePipe, &inFD);
	if (err.OK())
		{
		JString text;
		JReadAll(inFD, &text);
		text.TrimWhitespace();
		itsText->SetText(text);
		}

	ListenTo(this);
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:27,代码来源:CMChooseProcessDialog.cpp

示例6: JMount

JError
JFormatPartition
	(
	const JCharacter*	path,
	const JCharacter*	type,
	JProcess**			process
	)
{
	JBoolean writable, isTop;
	JString device;
	if (JIsMounted(path, &writable, &isTop, &device) && isTop)
		{
		JMount(path, kJFalse, kJTrue);
		if (!JIsMounted(path))
			{
			const JCharacter* argv[] = { "xterm", "-T", "Format disk", "-n", "Format disk",
										 "-e", "/sbin/mkfs", "-t", type, "-c", device, NULL };
			const JError err = JProcess::Create(process, argv, sizeof(argv));
			if (err.OK())
				{
				JThisProcess::Ignore(*process);
				}
			return err;
			}
		}

	*process = NULL;
	return JAccessDenied(path);
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:29,代码来源:jMountUtil_UNIX.cpp

示例7: assert

JError
JXImage::CreateFromJPEG
	(
	JXDisplay*			display,
	JXColormap*			colormap,
	const JCharacter*	fileName,
	JXImage**			image,
	const JBoolean		allowApproxColors
	)
{
	*image = new JXImage(display, colormap);
	assert( *image != NULL );

	const JBoolean saveApprox = colormap->WillApproximateColors();
	const JBoolean savePre    = colormap->WillPreemptivelyApproximateColors();
	colormap->ShouldApproximateColors(allowApproxColors);
	colormap->ShouldPreemptivelyApproximateColors(kJTrue);

	const JError err = (**image).ReadJPEG(fileName);

	colormap->ShouldApproximateColors(saveApprox);
	colormap->ShouldPreemptivelyApproximateColors(savePre);

	if (!err.OK())
		{
		delete *image;
		*image = NULL;
		}
	return err;
}
开发者ID:mta1309,项目名称:mulberry-lib-jx,代码行数:30,代码来源:JXImage.cpp

示例8: JBadPath

JError
JDirInfo::GoTo
	(
	const JCharacter* origDirName
	)
{
	JString dirName;
	if (JStringEmpty(origDirName) ||
		!JConvertToAbsolutePath(origDirName, NULL, &dirName))
		{
		return JBadPath(origDirName);
		}

	if (JSameDirEntry(dirName, *itsCWD))
		{
		Update();
		return JNoError();
		}
	JAppendDirSeparator(&dirName);

	const JString origCWD = *itsCWD;

	*itsCWD = dirName;
	const JError err = BuildInfo();
	if (err.OK())
		{
		Broadcast(PathChanged());
		}
	else
		{
		*itsCWD = origCWD;
		}

	return err;
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:35,代码来源:JDirInfo.cpp

示例9: GetText

JBoolean
JXRegexReplaceInput::InputValid()
{
	if (!JXInputField::InputValid())
		{
		return kJFalse;
		}
	else
		{
		const JString& text = GetText();

		if (!IsRequired() && text.IsEmpty())
			{
			return kJTrue;
			}

		const JError err = itsTestRegex->SetReplacePattern(text);
		if (err.OK())
			{
			return kJTrue;
			}
		else
			{
			err.ReportIfError();
			return kJFalse;
			}
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:28,代码来源:JXRegexReplaceInput.cpp

示例10: JGetCurrentDirectory

JError
JExecute
	(
	const JCharacter*		workingDirectory,
	const JCharacter*		argv[],
	const JSize				size,
	pid_t*					childPID,
	const JExecuteAction	toAction,
	int*					toFD,
	const JExecuteAction	fromAction,
	int*					fromFD,
	const JExecuteAction	errAction,
	int*					errFD
	)
{
	const JString origPath = JGetCurrentDirectory();
	JError err             = JChangeDirectory(workingDirectory);
	if (err.OK())
		{
		err = JExecute(argv, size, childPID, toAction, toFD, fromAction, fromFD, errAction, errFD);
		JChangeDirectory(origPath);
		}

	return err;
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:25,代码来源:jProcessUtil.cpp

示例11: JExecute

JError
JSimpleProcess::Create
(
    JSimpleProcess**			process,
    const JPtrArray<JString>&	argList,
    const JBoolean				deleteWhenFinished
)
{
    pid_t childPID;
    int errFD;
    const JError err = JExecute(argList, &childPID,
                                kJIgnoreConnection, NULL,
                                kJTossOutput, NULL,
                                kJCreatePipe, &errFD);
    if (err.OK())
    {
        *process = new JSimpleProcess(childPID, errFD, deleteWhenFinished);
        assert( *process != NULL );
    }
    else
    {
        *process = NULL;
    }

    return err;
}
开发者ID:mta1309,项目名称:mulberry-lib-jx,代码行数:26,代码来源:JSimpleProcess.cpp

示例12:

JBoolean
SVNPropertiesList::RemoveNextProperty()
{
	if (!itsRemovePropertyCmdList->IsEmpty())
		{
		const JString cmd = *(itsRemovePropertyCmdList->FirstElement());
		itsRemovePropertyCmdList->DeleteElement(1);

		JSimpleProcess* p;
		const JError err = JSimpleProcess::Create(&p, cmd, kJTrue);
		if (err.OK())
			{
			itsProcessList->Append(p);
			ListenTo(p);
			return kJTrue;
			}
		else
			{
			err.ReportIfError();
			return kJFalse;
			}
		}
	else
		{
		if ((GetDirector())->OKToStartActionProcess())
			{
			RefreshContent();
			}

		(GetDirector())->ScheduleStatusRefresh();
		return kJTrue;
		}
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:33,代码来源:SVNPropertiesList.cpp

示例13: fileList

void
CBSearchTextDialog::SearchFiles()
	const
{
	JString searchStr, replaceStr;
	JBoolean searchIsRegex, caseSensitive, entireWord, wrapSearch;
	JBoolean replaceIsRegex, preserveCase;
	JRegex* regex;

	JPtrArray<JString> fileList(JPtrArrayT::kDeleteAll),
					   nameList(JPtrArrayT::kDeleteAll);

	if (GetSearchParameters(
			&searchStr, &searchIsRegex, &caseSensitive, &entireWord, &wrapSearch,
			&replaceStr, &replaceIsRegex, &preserveCase,
			&regex) &&
		BuildSearchFileList(&fileList, &nameList))
		{
		const JError err =
			CBSearchDocument::Create(fileList, nameList,
									 searchStr, itsOnlyListFilesFlag,
									 itsListFilesWithoutMatchFlag);
		err.ReportIfError();
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:25,代码来源:CBSearchTextDialog.cpp

示例14: assert

JBoolean
SVNPropertiesList::CreateProperty1()
{
	assert( itsCreatePropertyDialog != NULL );

	const JString prop = JPrepArgForExec(itsCreatePropertyDialog->GetString());
	const JString file = JPrepArgForExec(itsFullName);

	JSubstitute subst;
	subst.DefineVariable("prop_name", prop);
	subst.DefineVariable("file_name", file);

	JString cmd = kPropEditCmd;
	subst.Substitute(&cmd);

	JSimpleProcess* p;
	const JError err = JSimpleProcess::Create(&p, cmd, kJTrue);
	if (err.OK())
		{
		itsProcessList->Append(p);
		ListenTo(p);
		return kJTrue;
		}
	else
		{
		err.ReportIfError();
		return kJFalse;
		}
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:29,代码来源:SVNPropertiesList.cpp

示例15: Broadcast

JBoolean
JDirInfo::ForceUpdate()
{
	if (JDirectoryExists(*itsCWD))
		{
		Broadcast(ContentsWillBeUpdated());

		const JError err = BuildInfo();
		if (err.OK())
			{
			return kJTrue;
			}
		}

	if (itsSwitchIfInvalidFlag)
		{
		JString path;
		if (!JGetHomeDirectory(&path) || !OKToCreate(path))
			{
			path = JGetRootDirectory();
			}
		GoTo(path);
		}
	else
		{
		itsIsValidFlag    = kJFalse;
		itsIsWritableFlag = kJFalse;
		itsDirEntries->CleanOut();
		itsVisEntries->CleanOut();
		itsAlphaEntries->CleanOut();
		}

	return kJFalse;
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:34,代码来源:JDirInfo.cpp


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