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


C++ MetaName::isEmpty方法代码示例

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


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

示例1: isSameDatabase

bool InternalConnection::isSameDatabase(thread_db* tdbb, const PathName& dbName,
		const MetaName& user, const string& pwd,
		const MetaName& role) const
{
	if (m_isCurrent)
	{
		const UserId* attUser = m_attachment->getHandle()->att_user;
		return ((user.isEmpty() || user == attUser->getUserName()) &&
				pwd.isEmpty() &&
				(role.isEmpty() || role == attUser->getSqlRole()));
	}

	return Connection::isSameDatabase(tdbb, dbName, user, pwd, role);
}
开发者ID:glaubitz,项目名称:firebird,代码行数:14,代码来源:InternalDS.cpp

示例2: attach

void InternalConnection::attach(thread_db* tdbb, const PathName& dbName,
		const MetaName& user, const string& pwd,
		const MetaName& role)
{
	fb_assert(!m_attachment);
	Database* dbb = tdbb->getDatabase();
	fb_assert(dbName.isEmpty() || dbName == dbb->dbb_database_name.c_str());

	// Don't wrap raised errors. This is needed for backward compatibility.
	setWrapErrors(false);

	Jrd::Attachment* attachment = tdbb->getAttachment();
	if ((user.isEmpty() || user == attachment->att_user->getUserName()) &&
		pwd.isEmpty() &&
		(role.isEmpty() || role == attachment->att_user->getSqlRole()))
	{
		m_isCurrent = true;
		m_attachment = attachment->getInterface();
	}
	else
	{
		m_isCurrent = false;
		m_dbName = dbb->dbb_database_name.c_str();
		generateDPB(tdbb, m_dpb, user, pwd, role);

		// Avoid change of m_dpb by validatePassword() below
		ClumpletWriter newDpb(m_dpb);
		validatePassword(tdbb, m_dbName, newDpb);

		FbLocalStatus status;
		{
			EngineCallbackGuard guard(tdbb, *this, FB_FUNCTION);
			RefPtr<JProvider> jInstance(JProvider::getInstance());
			jInstance->setDbCryptCallback(&status, tdbb->getAttachment()->att_crypt_callback);
			m_attachment.assignRefNoIncr(jInstance->attachDatabase(&status, m_dbName.c_str(),
				newDpb.getBufferLength(), newDpb.getBuffer()));
		}

		if (status->getState() & IStatus::STATE_ERRORS)
			raise(&status, tdbb, "JProvider::attach");
	}

	m_sqlDialect = (m_attachment->getHandle()->att_database->dbb_flags & DBB_DB_SQL_dialect_3) ?
					SQL_DIALECT_V6 : SQL_DIALECT_V5;
}
开发者ID:glaubitz,项目名称:firebird,代码行数:45,代码来源:InternalDS.cpp


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