本文整理汇总了C++中Db::name方法的典型用法代码示例。如果您正苦于以下问题:C++ Db::name方法的具体用法?C++ Db::name怎么用?C++ Db::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Db
的用法示例。
在下文中一共展示了Db::name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
//
// The main driver.
// This scans a database for referral records and forms corresponding
// credentials to trigger unlocks.
// Returns true if any valid unlock credentials were found; false otherwise.
// Only throws if the database is messed up.
//
bool DefaultCredentials::operator () (Db database)
{
if (!mMade) {
try {
// before we do anything else, see if we have a relation in the database of the appropriate type
KeychainSchema keychainSchema = mKeychainImpl->keychainSchema();
if (keychainSchema->hasRecordType(UnlockReferralRecord::recordType))
{
clear();
Table<UnlockReferralRecord> referrals(database);
for (Table<UnlockReferralRecord>::iterator it = referrals.begin(); it != referrals.end(); it++) {
switch ((*it)->type()) {
case CSSM_APPLE_UNLOCK_TYPE_KEY_DIRECT:
case CSSM_APPLE_UNLOCK_TYPE_WRAPPED_PRIVATE:
keyReferral(**it);
break;
default:
secdebug("kcreferral", "referral type %lu (to %s) not supported",
(unsigned long)(*it)->type(), (*it)->dbName().c_str());
break;
}
}
}
secdebug("kcreferral", "%lu samples generated", (unsigned long)size());
} catch (...) {
secdebug("kcreferral", "exception setting default credentials for %s; using standard value", database->name());
}
mMade = true;
}
return size() > 0; // got credentials?
}