本文整理汇总了C++中document::Ptr::year方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::year方法的具体用法?C++ Ptr::year怎么用?C++ Ptr::year使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类document::Ptr
的用法示例。
在下文中一共展示了Ptr::year方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
bool SQLiteDocumentDAO::update(Document::Ptr pub)
{
if(!pub) {
return false;
}
repository()->journalDAO()->saveOrUpdate(pub->journal());
QueryParameters params;
params.insert("title", pub->title());
params.insert("abstract", pub->abstract());
params.insert("year", pub->year());
params.insert("month", pub->month());
params.insert("conference", pub->conference());
params.insert("publisher", pub->publisher());
params.insert("volume", pub->volume());
params.insert("number", pub->number());
params.insert("url", pub->url());
params.insert("doi", pub->doi());
params.insert("isbn", pub->isbn());
params.insert("localURL", pub->localUrl());
params.insert("type", static_cast<uint>(pub->type()));
params.insert("isPublished", pub->isPublished());
params.insert("isPeerReviewed", pub->isPeerReviewed());
//params.insert("keywords", pub->keywords());
params.insert("series", pub->series());
params.insert("subTitle", pub->subTitle());
params.insert("pages", pub->pages().toString());
params.insert("authors", StringUtils::serialize(pub->authors()));
params.insert("editors", StringUtils::serialize(pub->editors()));
params.insert("citeKey", pub->citeKey());
if(pub->journal()) {
params.insert("journalId", pub->journal()->id());
} else {
params.insert("journalId", QVariant());
}
bool ok = QueryExecutor().update("document", makeQueryParameters("id", pub->id()), params);
if(ok) {
emit dataChanged();
}
return ok;
}
示例2: save
bool SQLiteDocumentDAO::save(Document::Ptr pub)
{
if(!pub) {
return false;
}
QueryExecutor executor(database());
QueryParameters params;
if(pub->journal()) {
Journal::Ptr realJournal = repository()->journalDAO()->findByName(pub->journal()->name(), true);
if(realJournal != pub->journal()) {
Journal::Ptr old = pub->journal();
pub->setJournal(realJournal);
delete old;
}
}
params.insert("title", pub->title());
params.insert("abstract", pub->abstract());
params.insert("year", pub->year());
params.insert("month", pub->month());
params.insert("conference", pub->conference());
params.insert("publisher", pub->publisher());
params.insert("volume", pub->volume());
params.insert("number", pub->number());
params.insert("url", pub->url());
params.insert("doi", pub->doi());
params.insert("isbn", pub->isbn());
params.insert("localURL", pub->localUrl());
params.insert("type", static_cast<uint>(pub->type()));
params.insert("isPublished", pub->isPublished());
params.insert("isPeerReviewed", pub->isPeerReviewed());
//params.insert("keywords", pub->keywords());
params.insert("series", pub->series());
params.insert("subTitle", pub->subTitle());
params.insert("pages", pub->pages().toString());
params.insert("authors", StringUtils::serialize(pub->authors()));
params.insert("editors", StringUtils::serialize(pub->editors()));
params.insert("citeKey", pub->citeKey());
if(pub->journal()) {
params.insert("journalId", pub->journal()->id());
} else {
params.insert("journalId", QVariant());
}
bool ok = executor.insert("document", params);
if(ok) {
qulonglong id = executor.lastInsertID();
pub->setId(id);
repository()->publications()->insert(id, pub);
emit dataChanged();
}
return ok;
}