- Timestamp:
- 01/22/10 19:44:34 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
punch-card-project/trunk/punch-card-editor/src/qpunchcard/format.h
r52 r59 9 9 class FileFormat; 10 10 class FileFormatFactory; 11 12 class Deck; 11 13 }; 12 14 13 15 #include "qpunchcard/card.h" 14 #include "qpunchcard/deck.h" 16 // #include "qpunchcard/deck.h" // nach unten verschoben, damit bloeder cc kompiliert 15 17 16 18 namespace QPunchCard { 17 19 18 20 class FileFormat { 21 QString name; 22 friend class FileFormatFactory; 19 23 public: 20 24 virtual ~FileFormat() {} 21 virtual bool write(QFile& /* target */, const Deck& /* source */) const = 0; 22 virtual bool read(QFile& /* source */, Deck& /* target */) const = 0; 25 virtual bool write(QFile& /* target */, const Deck* /* source */) const { qDebug("Default FileFormat write!"); return false; } 26 virtual bool read(QFile& /* source */, Deck* /* target */) const { qDebug("Default FileFormat read!"); return false; } 27 const QString& getName() const { return name; } 28 bool isNull() const { return name.isNull(); } 23 29 }; 24 30 … … 26 32 public: 27 33 static QList<QString> availableFormats(); 28 static const FileFormat*createFormat(const QString& name);34 static FileFormat createFormat(const QString& name); 29 35 static QString autoDetectFormat(const QFile& file); 30 36 }; 31 37 32 38 /**************************************************************************** 33 FileFormat (I/O) implementations 39 FileFormat (I/O) implementations (see jones.h for the most important one) 34 40 ***************************************************************************/ 35 36 class JonesFileFormat : public FileFormat {37 public:38 static int jones_column_to_integer(const Column& col);39 static Column jones_integer_to_column(int integer);40 41 bool write(QFile& target, const Deck& source) const;42 bool read(QFile& source, Deck& target) const;43 };44 41 45 42 class PunchCardMarkupLanguageFormat : public FileFormat { 46 43 public: 47 bool write(QFile& target, const Deck &source) const { return false; }48 bool read(QFile& source, Deck &target) const { return false; }44 bool write(QFile& target, const Deck* source) const { return false; } 45 bool read(QFile& source, Deck* target) const { return false; } 49 46 }; 50 47 51 48 }; // namespace QPunchCard 52 49 50 // hier eingebunden 51 #include "qpunchcard/deck.h" 53 52 54 53 #endif // FORMAT_H
Powered by
Expect where otherwise noted, content on this site is licensed under a