本文整理汇总了C++中Book::getCover方法的典型用法代码示例。如果您正苦于以下问题:C++ Book::getCover方法的具体用法?C++ Book::getCover怎么用?C++ Book::getCover使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Book
的用法示例。
在下文中一共展示了Book::getCover方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insertBook
/**
* @brief Add book \a b to the collection.
*
* @param b Book to be added.
*
* @exception DataBaseException Forwarding possible database error.
*
* @warning Make sure you DON'T SET the books id before calling this method.
*
* Adds \a b to the DataBase and sets its id. Nothing is done with the referenced
* authors, publishers and themes.
*/
void BookCollection::insertBook(Book &b) throw(DataBaseException)
{
PreparedStatement prepStmt("INSERT INTO books (isbn, title, edition, "
"critique, description, rating, cover, ebook, publishingyear, "
"udc, translator) VALUES ('%1', '%2', '%3', '%4', '%5', '%6', "
"'%7', '%8', '%9', '%10', '%11')", db->getType());
prepStmt.arg(b.getIsbn());
prepStmt.arg(b.getTitle().toStdString());
prepStmt.arg(b.getEdition());
prepStmt.arg(b.getCritique().toStdString());
prepStmt.arg(b.getDescription().toStdString());
prepStmt.arg(b.getRating());
prepStmt.arg(b.getCover().toStdString());
prepStmt.arg(b.getEbook().toStdString());
prepStmt.arg(b.getPubDate().toString("yyyy-MM-dd").toStdString());
prepStmt.arg(b.getUDC().toStdString());
prepStmt.arg(b.getTranslator().getId());
b.setId(db->insert(prepStmt));
}
示例2: updateBook
/**
* @brief Updates book.
*
* @param b Book to be updated.
*
* This method updates every field of the book, except the id and the referenced
* authors, publishers and themes.
*/
void BookCollection::updateBook(Book b) throw(DataBaseException)
{
PreparedStatement updBook("UPDATE books SET isbn = '%1', title = '%2',"
" edition = '%3', description = '%4', critique = '%5', rating ="
" '%6', cover = '%7', ebook = '%8', publishingyear = '%9', udc ="
" '%10', translator = '%11' WHERE id = '%12'", db->getType());
updBook.arg(b.getIsbn());
updBook.arg(b.getTitle().toStdString());
updBook.arg(b.getEdition());
updBook.arg(b.getDescription().toStdString());
updBook.arg(b.getCritique().toStdString());
updBook.arg(b.getRating());
updBook.arg(b.getCover().toStdString());
updBook.arg(b.getEbook().toStdString());
updBook.arg(b.getPubDate().toString("yyyy-MM-dd").toStdString());
updBook.arg(b.getUDC().toStdString());
updBook.arg(b.getTranslator().getId());
updBook.arg(b.getId());
db->exec(updBook);
}