示例#1
0
void IntlParametersBlock::processParametersBlock(ProcessString* processString, ClumpletWriter& pb)
{
	for (pb.rewind(); !pb.isEof(); pb.moveNext())
	{
		UCHAR tag = pb.getClumpTag();
		string s;

		switch (checkTag(tag))
		{
		case TAG_SKIP:
			break;

		case TAG_STRING:
			pb.getString(s);
			processString(s);
			pb.deleteClumplet();
			pb.insertString(tag, s);
			break;

		case TAG_COMMAND_LINE:
			pb.getString(s);
			processCommandLine(processString, s);
			pb.deleteClumplet();
			pb.insertString(tag, s);
			break;
		}
	}
}
void IntlParametersBlock::processParametersBlock(ProcessString* processString, ClumpletWriter& pb)
{
	const char* tagName = NULL;
	try
	{
		for (pb.rewind(); !pb.isEof(); )
		{
			UCHAR tag = pb.getClumpTag();
			string s;

			tagName = NULL;
			switch (checkTag(tag, &tagName))
			{
			case TAG_SKIP:
				pb.moveNext();
				break;

			case TAG_STRING:
				pb.getString(s);
				processString(s);
				pb.deleteClumplet();
				pb.insertString(tag, s);
				break;

			case TAG_COMMAND_LINE:
				pb.getString(s);
				processCommandLine(processString, s);
				pb.deleteClumplet();
				pb.insertString(tag, s);
				break;
			}
		}
	}
	catch (const Firebird::status_exception& st)
	{
		LocalStatus ls;
		CheckStatusWrapper l(&ls);
		st.stuffException(&l);
		if ((l.getState() & IStatus::STATE_ERRORS) && (l.getErrors()[1] == isc_bad_conn_str) && tagName)
		{
			Arg::Gds newErrors(isc_intl_char);
			newErrors << tagName;

			const ISC_STATUS* errors = l.getErrors();
			newErrors << Arg::StatusVector(errors + 2);		// skip isc_bad_conn_str

			l.setErrors(newErrors.value());
			status_exception::raise(&l);
		}

		// other case leave exception as is
		throw;
	}
}