IWORKDiscardContext.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/*
3 * This file is part of the libetonyek project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#ifndef IWORKDISCARDCONTEXT_H_INCLUDED
11#define IWORKDISCARDCONTEXT_H_INCLUDED
12
13#include <memory>
14
15#include "IWORKXMLContext.h"
16
17namespace libetonyek
18{
19
20class IWORKXMLParserState;
21
22/* Warning in g++ because std::enable_shared_from_this<IWORKDiscardContext> has no virtual
23 destructor.
24
25 If we replace public by protected, error with clang++ in KEY2Parser.cpp:1595 when doing
26 std::make_shared<DiscardContext>(m_state)
27 */
28#if defined __GNUC__ && !defined __clang__
29#pragma GCC diagnostic push
30#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
31#endif
32class IWORKDiscardContext : public IWORKXMLContext, public std::enable_shared_from_this<IWORKDiscardContext>
33{
34#if defined __GNUC__ && !defined __clang__
35#pragma GCC diagnostic pop
36#endif
37 struct Data;
38
39public:
41protected:
42 void startOfElement() override;
43 void attribute(int name, const char *value) override;
44 IWORKXMLContextPtr_t element(int name) override;
45 void text(const char *value) override;
46 void endOfElement() override;
47
48private:
50 unsigned m_level;
52 std::shared_ptr<Data> m_data;
53};
54
55}
56
57#endif // IWORKDISCARDCONTEXT_H_INCLUDED
58
59/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Definition IWORKDiscardContext.h:33
IWORKXMLParserState & m_state
Definition IWORKDiscardContext.h:49
IWORKDiscardContext(IWORKXMLParserState &state)
Definition IWORKDiscardContext.cpp:59
void attribute(int name, const char *value) override
Process an attribute.
Definition IWORKDiscardContext.cpp:77
void startOfElement() override
Signalize the start of an element.
Definition IWORKDiscardContext.cpp:67
bool m_enableCollector
Definition IWORKDiscardContext.h:51
unsigned m_level
Definition IWORKDiscardContext.h:50
void endOfElement() override
Signalize the end of an element.
Definition IWORKDiscardContext.cpp:133
std::shared_ptr< Data > m_data
Definition IWORKDiscardContext.h:52
Definition IWORKXMLContext.h:23
Definition IWORKXMLParserState.h:32
@ value
Definition IWORKToken.h:631
@ text
Definition IWORKToken.h:472
@ element
Definition IWORKToken.h:192
@ name
Definition IWORKToken.h:585
Definition IWORKBezierElement.cpp:21
std::shared_ptr< IWORKXMLContext > IWORKXMLContextPtr_t
Definition IWORKXMLContext.h:20
Definition IWORKDiscardContext.cpp:34

Generated for libetonyek by doxygen 1.12.0