Example #1
0
void DocbookGenerator::writeAuthorGroup(QTextStream &doc, ListViewInterface *item)
{
    kdDebug(100200) << "DocTreeViewImpl::writeAuthorGroup()" << endl;
    // read item's content
    QString whoAmI = (item->getValue(KSayItGlobal::XMLCONTEXTNAME)).toString();
    if ( whoAmI != "AuthorGroup" )
        return;

    // add node to document
    doc << "<AuthorGroup>" << endl;

    // process childs
    ListViewInterface *i = static_cast<ListViewInterface*>(item->firstChild());
    QString itemType;
    while( i ){
        itemType = (i->getValue(KSayItGlobal::XMLCONTEXTNAME)).toString();
        if ( itemType == "Author" ){
            writeAuthor( doc, i );
        }
        // next child
        i = static_cast<ListViewInterface*>(i->nextSibling());
    }

    doc << "</AuthorGroup>" << endl;
}
Example #2
0
Book::Book(string title, string author, string year) //overloaded constructor for loading the book collection from a file into memory
{
	writeTitle(title);
	writeAuthor(author);
	writeCopyYear(year); 
} // constructor for loading from memory