本文整理汇总了C++中DatabasePtr::get方法的典型用法代码示例。如果您正苦于以下问题:C++ DatabasePtr::get方法的具体用法?C++ DatabasePtr::get怎么用?C++ DatabasePtr::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabasePtr
的用法示例。
在下文中一共展示了DatabasePtr::get方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseDatabase
//-----------------------------------------------------------------------------
bool Root::parseDatabase(ServerPtr server, QDomNode& xmlnParent)
{
Q_ASSERT(server);
Q_ASSERT(!xmlnParent.isNull());
DatabasePtr database = server->addDatabase();
SubjectLocker locker(database.get());
for (QDomElement xmln = xmlnParent.firstChildElement();
!xmln.isNull();
xmln = xmln.nextSiblingElement())
{
QString value = xmln.text();
if (xmln.tagName() == QString::fromLatin1("name"))
database->setName_(value);
else if (xmln.tagName() == QString::fromLatin1("path"))
database->setPath(value);
else if (xmln.tagName() == QString::fromLatin1("charset"))
database->setConnectionCharset(value);
else if (xmln.tagName() == QString::fromLatin1("username"))
database->setUsername(value);
else if (xmln.tagName() == QString::fromLatin1("password"))
database->setRawPassword(value);
else if (xmln.tagName() == QString::fromLatin1("encrypted") && value == QString::fromLatin1("1"))
database->getAuthenticationMode().setStoreEncryptedPassword();
else if (xmln.tagName() == QString::fromLatin1("authentication"))
database->getAuthenticationMode().setConfigValue(value);
else if (xmln.tagName() == QString::fromLatin1("role"))
database->setRole(value);
else if (xmln.tagName() == QString::fromLatin1("id"))
{
bool isOk = false;
unsigned long id = value.toULong(&isOk);
if (isOk)
database->setId(id);
}
}
// make sure the database has an Id before Root::save() is called,
// otherwise a new Id will be generated then, but the generator value
// will not be stored because it's at the beginning of the file.
database->getId();
return true;
}
示例2: subjectRemoved
//! closes window if database is removed (unregistered)
void EventWatcherFrame::subjectRemoved(Subject* subject)
{
DatabasePtr db = getDatabase();
if (!db || !db->isConnected() || subject == db.get())
Close();
}
示例3: MetadataItem
//-----------------------------------------------------------------------------
Exception::Exception(DatabasePtr database, const QString& name)
: MetadataItem(ntException, database.get(), name), numberM(0)
{
}
示例4: MetadataItem
//-----------------------------------------------------------------------------
Generator::Generator(DatabasePtr database, const QString& name)
: MetadataItem(ntGenerator, database.get(), name)
{
}
示例5: MetadataItem
Function::Function(DatabasePtr database, const wxString& name)
: MetadataItem(ntFunction, database.get(), name)
{
}
示例6: MetadataItem
Domain::Domain(DatabasePtr database, const wxString& name)
: MetadataItem((hasSystemPrefix(name) ? ntSysDomain : ntDomain),
database.get(), name)
{
}