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
17 namespace libetonyek
18 {
19
20 class IWORKXMLParserState;
21
22 class IWORKDiscardContext : public IWORKXMLContext, public std::enable_shared_from_this<IWORKDiscardContext>
23 {
24 struct Data;
25
26 public:
27 explicit IWORKDiscardContext(IWORKXMLParserState &state);
28
29 protected:
30 void startOfElement() override;
31 void attribute(int name, const char *value) override;
32 IWORKXMLContextPtr_t element(int name) override;
33 void text(const char *value) override;
34 void endOfElement() override;
35
36 private:
37 IWORKXMLParserState &m_state;
38 unsigned m_level;
39 bool m_enableCollector;
40 std::shared_ptr<Data> m_data;
41 };
42
43 }
44
45 #endif // IWORKDISCARDCONTEXT_H_INCLUDED
46
47 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek
Definition: IWORKBezierElement.cpp:18
libetonyek::IWORKDiscardContext::m_data
std::shared_ptr< Data > m_data
Definition: IWORKDiscardContext.h:40
libetonyek::IWORKXMLContextPtr_t
std::shared_ptr< IWORKXMLContext > IWORKXMLContextPtr_t
Definition: IWORKXMLContext.h:18
libetonyek::IWORKXMLContext
Definition: IWORKXMLContext.h:22
libetonyek::IWORKDiscardContext::attribute
void attribute(int name, const char *value) override
Process an attribute.
Definition: IWORKDiscardContext.cpp:64
libetonyek::IWORKDiscardContext::m_enableCollector
bool m_enableCollector
Definition: IWORKDiscardContext.h:39
libetonyek::IWORKDiscardContext::m_level
unsigned m_level
Definition: IWORKDiscardContext.h:38
name
const char * name
Definition: IWORKToken.cpp:43
libetonyek::IWORKDiscardContext::endOfElement
void endOfElement() override
Signalize the end of an element.
Definition: IWORKDiscardContext.cpp:116
libetonyek::IWORKDiscardContext::text
void text(const char *value) override
Process textual content of an element.
Definition: IWORKDiscardContext.cpp:112
libetonyek::IWORKXMLParserState
Definition: IWORKXMLParserState.h:30
libetonyek::IWORKDiscardContext::startOfElement
void startOfElement() override
Signalize the start of an element.
Definition: IWORKDiscardContext.cpp:54
libetonyek::IWORKDiscardContext::IWORKDiscardContext
IWORKDiscardContext(IWORKXMLParserState &state)
Definition: IWORKDiscardContext.cpp:46
libetonyek::IWORKDiscardContext::m_state
IWORKXMLParserState & m_state
Definition: IWORKDiscardContext.h:37
libetonyek::IWORKDiscardContext
Definition: IWORKDiscardContext.h:22
libetonyek::IWORKDiscardContext::Data
Definition: IWORKDiscardContext.cpp:34
IWORKXMLContext.h
libetonyek::IWORKDiscardContext::element
IWORKXMLContextPtr_t element(int name) override
Create a context for parsing a child element.
Definition: IWORKDiscardContext.cpp:68