KEYParser.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /*
00003  * This file is part of the libetonyek project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  */
00009 
00010 #ifndef KEYPARSER_H_INCLUDED
00011 #define KEYPARSER_H_INCLUDED
00012 
00013 #include "libetonyek_utils.h"
00014 #include "KEYXMLReader.h"
00015 
00016 namespace libetonyek
00017 {
00018 
00019 class KEYCollector;
00020 class KEYDefaults;
00021 
00022 class KEYParser
00023 {
00024   // -Weffc++
00025   KEYParser(const KEYParser &);
00026   KEYParser &operator=(const KEYParser &);
00027 
00028 public:
00029   KEYParser(const WPXInputStreamPtr_t &input, KEYCollector *collector, const KEYDefaults &defaults);
00030   virtual ~KEYParser() = 0;
00031   bool parse();
00032 
00033   KEYCollector *getCollector() const;
00034   const KEYDefaults &getDefaults() const;
00035 
00036 private:
00037   virtual void processXmlNode(const KEYXMLReader &reader) = 0;
00038   virtual KEYXMLReader::TokenizerFunction_t getTokenizer() const = 0;
00039 
00040   bool processXmlDocument(const KEYXMLReader &reader);
00041 
00042 private:
00043   WPXInputStreamPtr_t m_input;
00044   KEYCollector *m_collector;
00045   const KEYDefaults &m_defaults;
00046 };
00047 
00048 } // namespace libetonyek
00049 
00050 #endif //  KEYPARSER_H_INCLUDED
00051 
00052 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */