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 /* 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
32 class 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 
39 public:
41 protected:
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 
48 private:
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: */
std::shared_ptr< Data > m_data
Definition: IWORKDiscardContext.h:52
std::shared_ptr< IWORKXMLContext > IWORKXMLContextPtr_t
Definition: IWORKXMLContext.h:18
Definition: IWORKXMLContext.h:22
Definition: IWORKToken.h:631
void attribute(int name, const char *value) override
Process an attribute.
Definition: IWORKDiscardContext.cpp:77
bool m_enableCollector
Definition: IWORKDiscardContext.h:51
unsigned m_level
Definition: IWORKDiscardContext.h:50
const char * name
Definition: IWORKToken.cpp:43
void endOfElement() override
Signalize the end of an element.
Definition: IWORKDiscardContext.cpp:133
void text(const char *value) override
Process textual content of an element.
Definition: IWORKDiscardContext.cpp:129
Definition: IWORKXMLParserState.h:31
void startOfElement() override
Signalize the start of an element.
Definition: IWORKDiscardContext.cpp:67
IWORKDiscardContext(IWORKXMLParserState &state)
Definition: IWORKDiscardContext.cpp:59
IWORKXMLParserState & m_state
Definition: IWORKDiscardContext.h:49
Definition: IWORKDiscardContext.h:32
Definition: IWORKDiscardContext.cpp:33
IWORKXMLContextPtr_t element(int name) override
Create a context for parsing a child element.
Definition: IWORKDiscardContext.cpp:81

Generated for libetonyek by doxygen 1.8.6