|
//
// Copyright (c) 2009 Roman Kecher (rmn@cplusplus.co.il)
//
// Distributed under the Code Project Open License, Version 1.02.
// See http://www.codeproject.com/info/cpol10.aspx
//
#ifndef __KNOWN_FORMAT_FACTORY_H__
#define __KNOWN_FORMAT_FACTORY_H__
#include "types.h"
#include "knownformatabstractfactory.h"
#include <vector>
#include <string>
/**
* This class is a singleton, holding an isntance of
* every format factory in the system.
* Given a filename it is able to go over all known
* formats and generate a KnownFormat object.
*/
class KnownFormatFactory {
public:
bool addFormat (KnownFormatAbsFactoryHandle factory);
KnownFormatHandle create (const std::string &filename) const;
static KnownFormatFactory &inst ();
private:
typedef std::vector<KnownFormatAbsFactoryHandle> FactoryVector;
FactoryVector m_factories;
KnownFormatFactory () {}
KnownFormatFactory (const KnownFormatFactory &f) {}
KnownFormatFactory &operator= (const KnownFormatFactory &f);
};
#endif // __KNOWN_FORMAT_FACTORY_H__
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.