util/parser/ParserFactory.h

Go to the documentation of this file.
00001 /*-----------------------------------------------------------------------------
00002 Name:      ParserFactory.h
00003 Project:   xmlBlaster.org
00004 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
00005 Comment:   The abstraction parser for xml literals
00006 -----------------------------------------------------------------------------*/
00007 
00008 #ifndef _UTIL_PARSER_PARSERFACTORY_H
00009 #define _UTIL_PARSER_PARSERFACTORY_H
00010 
00011 #include <util/xmlBlasterDef.h>
00012 #include <util/parser/I_Parser.h>
00013 #include <util/Global.h>
00014 #include <util/parser/XmlHandlerBase.h>
00015 
00016 namespace org { namespace xmlBlaster { namespace util { namespace parser {
00017     
00027 class Dll_Export ParserFactory {
00028    friend class Sax2Parser; // g++ 2.95.3 warning: `class org::xmlBlaster::util::parser::ParserFactory' only defines private constructors and has no friends
00029 
00030    private:
00031    const std::string ME;
00032    bool isInitialized_;
00033    std::string locale_;
00034 
00035    static ParserFactory* factory_;
00036    
00037    ParserFactory();
00038    ParserFactory(const ParserFactory& factory);
00039    ParserFactory& operator =(const ParserFactory& factory);
00040 
00041    public:
00042    ~ParserFactory();
00043 
00048    static ParserFactory& getFactory();
00049 
00055    std::string getLocale(org::xmlBlaster::util::Global& global);
00056 
00066    void initialize(org::xmlBlaster::util::Global& global);
00067 
00075    I_Parser* createParser(org::xmlBlaster::util::Global& global, XmlHandlerBase *handler);
00076 };
00077 
00078 }}}} // namespace
00079 
00080 #endif