Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

dataformat.h

Go to the documentation of this file.
00001 
00002 /***************************************************************************
00003     copyright            : (C) 2000 by Marko Grönroos
00004     email                : magi@iki.fi
00005 **/
00006 
00015 #ifndef __DATAFORMAT_H__
00016 #define __DATAFORMAT_H__
00017 
00018 #include "patternset.h"
00019 
00020 class DataFormat; // Internal
00021 
00022 EXCEPTIONCLASS (invalid_filename);
00023 
00025 //    ___                   -----                          |     o          //
00026 //    |  \   ___   |   ___  |                     ___   |  |       |        //
00027 //    |   |  ___| -+-  ___| |---   __  |/\ |/|/|  ___| -+- |     | |---     //
00028 //    |   | (   |  |  (   | |     /  \ |   | | | (   |  |  |     | |   )    //
00029 //    |__/   \__|   \  \__| |     \__/ |   | | |  \__|   \ |____ | |__/     //
00031 
00037 class DataFormatLib {
00038   public:
00039     static void     load    (const String& filename, PatternSet& set) throw (file_not_found, invalid_format, assertion_failed);
00040     static void     load    (TextIStream& in, PatternSet& set, const String& filetype=".raw") throw (invalid_format, assertion_failed);
00041     
00046     static void     save    (const String& filename, const PatternSet& set) throw (invalid_filename);
00047 
00048   protected:
00053     static DataFormat*  create      (const String& filename);
00054 };
00055 
00057 //           ___                   -----                                    //
00058 //           |  \   ___   |   ___  |                     ___   |            //
00059 //           |   |  ___| -+-  ___| |---   __  |/\ |/|/|  ___| -+-           //
00060 //           |   | (   |  |  (   | |     /  \ |   | | | (   |  |            //
00061 //           |__/   \__|   \  \__| |     \__/ |   | | |  \__|   \           //
00063 
00070 class DataFormat {
00071   public:
00072 
00077     virtual void    load    (TextIStream& in, PatternSet& set) const=0;
00078     virtual void    save    (FILE* out, const PatternSet& set) const {MUST_OVERLOAD}
00079 
00080   protected:
00081 };
00082 
00083 
00084 
00085 #endif
00086 

Generated on Thu Feb 10 20:06:44 2005 for Inanna by doxygen1.2.18