36 #include "filehtmlwriter.h" 43 FileHtmlWriter::FileHtmlWriter( const TQString & filename ) 45 mFile( filename.isEmpty() ? TQString( "filehtmlwriter.out" ) : filename ) 47 mStream.setEncoding( TQTextStream::UnicodeUTF8 ); 50 FileHtmlWriter::~FileHtmlWriter() { 51 if ( mFile.isOpen() ) { 52 kdWarning( 5006 ) << "FileHtmlWriter: file still open!" << endl; 53 mStream.unsetDevice(); 58 void FileHtmlWriter::begin( const TQString & css ) { 61 write( "<!-- CSS Definitions \n" + css + "-->\n" ); 64 void FileHtmlWriter::end() { 66 mStream.unsetDevice(); 70 void FileHtmlWriter::reset() { 71 if ( mFile.isOpen() ) { 72 mStream.unsetDevice(); 77 void FileHtmlWriter::write( const TQString & str ) { 82 void FileHtmlWriter::queue( const TQString & str ) { 86 void FileHtmlWriter::flush() { 90 void FileHtmlWriter::openOrWarn() { 91 if ( mFile.isOpen() ) { 92 kdWarning( 5006 ) << "FileHtmlWriter: file still open!" << endl; 93 mStream.unsetDevice(); 96 if ( !mFile.open( IO_WriteOnly ) ) 97 kdWarning( 5006 ) << "FileHtmlWriter: Cannot open file " << mFile.name() << endl; 99 mStream.setDevice( &mFile ); 102 void FileHtmlWriter::embedPart( const TQCString & contentId, const TQString & url ) { 103 mStream << "<!-- embedPart(contentID=" << contentId << ", url=" << url << ") -->" << endl;
|