void Exception::formatEntry(std::ostream &stream, size_t depth) const {
	LocaleUtils::CLocaleScope localeScope(stream);

	if (depth > maxDepth_) {
		return;
	}

	if (hasTypeName(depth)) {
		formatTypeName(stream, depth);
	}
	else {
		stream << "(Unknown exception)";
	}

	if (hasFileName(depth)) {
		stream << " ";
		formatFileName(stream, depth);
	}

	if (hasFunctionName(depth)) {
		stream << " ";
		formatFunctionName(stream, depth);
	}

	if (hasLineNumber(depth)) {
		stream << " line=" << getLineNumber(depth);
	}

	if (hasErrorCode(depth)) {
		stream << " [";

		if (!hasErrorCodeName(depth)) {
			stream << "Code:";
		}

		stream << getErrorCode(depth);

		if (hasErrorCodeName(depth)) {
			stream << ":";
			formatErrorCodeName(stream, depth);
		}

		stream << "]";
	}

	if (hasMessage(depth)) {
		stream << " " ;
		formatMessage(stream, depth);
	}
#ifdef UTIL_STACK_TRACE_ENABLED

	if (hasStackTrace(depth)) {
		stream << " : " ;
		formatStackTrace(stream, depth);
	}
#endif
}
Exemple #2
0
void BaseEditor::actionSave()
{
	if (!hasFileName())
	{
		return actionSaveAs();
	}

	if(onSave())
	{
		auto editor = pImpl_->get<IEditor>();
		TF_ASSERT(editor != nullptr);
		if (editor)
		{
			editor->save();
		};
	}
}