Source: channelio.h


Annotated List
Files
Globals
Hierarchy
Index
// -*- c++ -*-

/*
 *
 * Copyright (C) 2002 Richard Moore 
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef CHANNELIO_H
#define CHANNELIO_H

#include 
#include 

#include "channelioformat.h"

class ChannelStore;

/**
 * Support for loading and saving channel suites in different formats.
 *
 * @author Richard Moore, 
 * @version $Id: channelio.h,v 1.3 2002/03/15 23:29:45 rich Exp $
 */
class ChannelIO
{
public:
    typedef ChannelIOFormat Format;
    typedef ChannelIOFormatList FormatList;

    /**
     * Loads a channel file into the specified store. 
     */
    static bool load( ChannelStore *store, const QString &filename, const char *fmt=0 );

    /**
     * Save the channels in the store to the specified file. 
     */
    static bool save( ChannelStore *store, const QString &filename, const char *fmt=0 );

    /**
     * Registers the specified format.
     */
    static void registerFormat( ChannelIOFormat *format );

    /**
     * Returns a list of all the known formats.
     */
    static ChannelIOFormatList *formats();

    /**
     * Try to find a format handler for the specified format. The flags
     * indicate the facility we need, ie. reading or writing. If there
     * is no matching handler, 0 is returned.
     */
    static ChannelIOFormat *findFormat( const char *fmt, int flags = ChannelIOFormat::FormatRead );

    /**
     * Tries to guess the format from the filename.
     */
    static const char *guessFormat( const QString &filename );

private:
    /**
     * Registers the built-in formats (happens automatically).
     */
    static void registerFormats();
};

#endif // CHANNELIO_H










Generated by: rich on pegasus on Wed Mar 20 03:16:53 2002, using kdoc 2.0a53.