当前位置: 首页>>代码示例>>C++>>正文


C++ Book::getDescription方法代码示例

本文整理汇总了C++中Book::getDescription方法的典型用法代码示例。如果您正苦于以下问题:C++ Book::getDescription方法的具体用法?C++ Book::getDescription怎么用?C++ Book::getDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Book的用法示例。


在下文中一共展示了Book::getDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main()
{
	Romance novel;
	Book book;

	cout << novel.getDescription() << endl;
	cout << book.getDescription() << endl;
	cout << novel.getHeight() << endl;
	cout << book.getHeight() << endl;

	return 0;
}
开发者ID:zzragida,项目名称:CppExamples,代码行数:12,代码来源:Book.cpp

示例2: 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));
}
开发者ID:jgastal,项目名称:plivros,代码行数:32,代码来源:BookCollection.cpp

示例3: 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);
}
开发者ID:jgastal,项目名称:plivros,代码行数:29,代码来源:BookCollection.cpp


注:本文中的Book::getDescription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。