예제 #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;
		}
	}
}
예제 #2
0
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;
	}
}
예제 #3
0
bool putFileArgument(char**& av, ClumpletWriter& spb, unsigned int tag)
{
	if (! *av)
		return false;

	const char* s = NULL;
	switch (fb_utils::fetchPassword(*av, s))
	{
	case fb_utils::FETCH_PASS_OK:
		break;
	case fb_utils::FETCH_PASS_FILE_OPEN_ERROR:
		(Arg::Gds(isc_fbsvcmgr_fp_open) << *av << Arg::OsError()).raise();
		break;
	case fb_utils::FETCH_PASS_FILE_READ_ERROR:
		(Arg::Gds(isc_fbsvcmgr_fp_read) << *av << Arg::OsError()).raise();
		break;
	case fb_utils::FETCH_PASS_FILE_EMPTY:
		(Arg::Gds(isc_fbsvcmgr_fp_empty) << *av).raise();
		break;
	}

	spb.insertString(tag, s, fb_strlen(s));
	++av;

	return true;
}
예제 #4
0
bool putStringArgument(char**& av, ClumpletWriter& spb, unsigned int tag)
{
	if (! *av)
		return false;

	char* x = *av++;
	string s(tag == isc_spb_password ? fb_utils::get_passwd(x) : x);
	spb.insertString(tag, s);

	return true;
}