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 IWORKDISCARDCONTEXT_H_INCLUDED 00011 #define IWORKDISCARDCONTEXT_H_INCLUDED 00012 00013 #include <boost/enable_shared_from_this.hpp> 00014 #include <boost/shared_ptr.hpp> 00015 00016 #include "IWORKXMLContext.h" 00017 00018 namespace libetonyek 00019 { 00020 00021 class IWORKXMLParserState; 00022 00023 class IWORKDiscardContext : public IWORKXMLContext, public boost::enable_shared_from_this<IWORKDiscardContext> 00024 { 00025 struct Data; 00026 00027 public: 00028 explicit IWORKDiscardContext(IWORKXMLParserState &state); 00029 00030 protected: 00031 virtual void startOfElement(); 00032 virtual void attribute(int name, const char *value); 00033 virtual IWORKXMLContextPtr_t element(int name); 00034 virtual void text(const char *value); 00035 virtual void endOfElement(); 00036 00037 private: 00038 IWORKXMLParserState &m_state; 00039 unsigned m_level; 00040 bool m_enableCollector; 00041 boost::shared_ptr<Data> m_data; 00042 }; 00043 00044 } 00045 00046 #endif // IWORKDISCARDCONTEXT_H_INCLUDED 00047 00048 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */