本文整理汇总了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);
}
示例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;
}