#include <filewriter.h>

Public Member Functions | |
| CFileWriter (const QString &ext, const QString &desc) | |
| virtual const objtype | read (const QString &) const |
| QString | readDialog (objtype &dest, const QString &filename="") const |
| virtual void | write (const objtype &, const QString &) const =0 |
| QString | writeDialog (const objtype &obj, const QString &filename=QString::null) const |
| QString | getExtension () const |
| bool | isDocument (QString filename) const |
Static Public Member Functions | |
| static void | readErrorMessage () |
| static void | writeErrorMessage () |
Protected Attributes | |
| QString | _ext |
| QString | _desc |
Definition at line 59 of file filewriter.h.
| CFileWriter< objtype >::CFileWriter | ( | const QString & | ext, | |
| const QString & | desc | |||
| ) | [inline] |
The constructor.
| ext | the file extension | |
| desc | description of the file type |
Definition at line 67 of file filewriter.h.
| virtual const objtype CFileWriter< objtype >::read | ( | const QString & | ) | const [inline, virtual] |
Perform the actual reading operation, may be overriden to provide this functionality.
Reimplemented in XmlWriterTempl< objtype >, XmlWriterTempl< CSailDef >, XmlWriterTempl< CPanelGroup >, XmlWriterTempl< CPrefs >, XmlWriterTempl< CHullDef >, XmlWriterTempl< CRigDef >, and XmlWriterTempl< CBoatDef >.
Definition at line 75 of file filewriter.h.
Referenced by CFileWriter< CBoatDef >::readDialog().
| QString CFileWriter< objtype >::readDialog | ( | objtype & | dest, | |
| const QString & | filename = "" | |||
| ) | const [inline] |
Display a dialog then read file.
| dest | the object we read to | |
| filename | initial file name |
Definition at line 86 of file filewriter.h.
| static void CFileWriter< objtype >::readErrorMessage | ( | ) | [inline, static] |
Show an error message indicating that reading failed.
Definition at line 108 of file filewriter.h.
Referenced by CFileWriter< CBoatDef >::readDialog().
| virtual void CFileWriter< objtype >::write | ( | const objtype & | , | |
| const QString & | ||||
| ) | const [pure virtual] |
Perform the actual writing operation, must be overriden.
Implemented in CSailCarlsonWriter, CSailDxfWriter2d, CSailDxfWriter3d, CSailHandWriter, CSailSvgWriter, CSailTxtWriter, XmlWriterTempl< objtype >, XmlWriterTempl< CSailDef >, XmlWriterTempl< CPanelGroup >, XmlWriterTempl< CPrefs >, XmlWriterTempl< CHullDef >, XmlWriterTempl< CRigDef >, and XmlWriterTempl< CBoatDef >.
Referenced by CFileWriter< CBoatDef >::writeDialog().
| QString CFileWriter< objtype >::writeDialog | ( | const objtype & | obj, | |
| const QString & | filename = QString::null | |||
| ) | const [inline] |
Opens of a dialog to ask for a filename then writes to a file.
| obj | The object to write. | |
| filename | The filename to start off with (default = "") |
Definition at line 125 of file filewriter.h.
| static void CFileWriter< objtype >::writeErrorMessage | ( | ) | [inline, static] |
Show an error message indicating that writing failed.
Definition at line 149 of file filewriter.h.
Referenced by CFileWriter< CBoatDef >::writeDialog().
| QString CFileWriter< objtype >::getExtension | ( | ) | const [inline] |
Return the file extension associated with this CFileWriter.
Definition at line 157 of file filewriter.h.
| bool CFileWriter< objtype >::isDocument | ( | QString | filename | ) | const [inline] |
Returns whether the given file is associated with this CFileWriter.
Definition at line 165 of file filewriter.h.
QString CFileWriter< objtype >::_ext [protected] |
file extension
Definition at line 168 of file filewriter.h.
Referenced by CFileWriter< CBoatDef >::getExtension(), CFileWriter< CBoatDef >::isDocument(), CFileWriter< CBoatDef >::readDialog(), and CFileWriter< CBoatDef >::writeDialog().
QString CFileWriter< objtype >::_desc [protected] |
description of the file type
Definition at line 174 of file filewriter.h.
Referenced by CFileWriter< CBoatDef >::readDialog(), and CFileWriter< CBoatDef >::writeDialog().
1.5.6