IWORKXMLContext.h Source File documentation

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

IWORKXMLContext.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 IWORKXMLCONTEXT_H_INCLUDED
11 #define IWORKXMLCONTEXT_H_INCLUDED
12
13 #include <boost/shared_ptr.hpp>
14
15 namespace libetonyek
16 {
17
18 class IWORKXMLContext;
19
20 typedef boost::shared_ptr<IWORKXMLContext> IWORKXMLContextPtr_t;
21
22 class IWORKXMLContext
23 {
24 public:
25 virtual ~IWORKXMLContext() = 0;
26
32 virtual void startOfElement() = 0;
33
38 virtual void attribute(int name, const char *value) = 0;
39
45 virtual IWORKXMLContextPtr_t element(int name) = 0;
46
52 virtual void text(const char *value) = 0;
53
56 virtual void endOfElement() = 0;
57 };
58
59 template<typename Context, typename Arg>
60 IWORKXMLContextPtr_t makeContext(Arg &arg)
61 {
62 return IWORKXMLContextPtr_t(new Context(arg));
63 }
64
65 template<typename Context, typename Arg1, typename Arg2>
66 IWORKXMLContextPtr_t makeContext(Arg1 &arg1, Arg2 &arg2)
67 {
68 return IWORKXMLContextPtr_t(new Context(arg1, arg2));
69 }
70
71 template<typename Context, typename Arg1, typename Arg2>
72 IWORKXMLContextPtr_t makeContext(Arg1 &arg1, const Arg2 &arg2)
73 {
74 return IWORKXMLContextPtr_t(new Context(arg1, arg2));
75 }
76
77 template<typename Context, typename Arg1, typename Arg2, typename Arg3>
78 IWORKXMLContextPtr_t makeContext(Arg1 &arg1, Arg2 &arg2, const Arg3 &arg3)
79 {
80 return IWORKXMLContextPtr_t(new Context(arg1, arg2, arg3));
81 }
82
83 template<typename Context, typename Arg1, typename Arg2, typename Arg3>
84 IWORKXMLContextPtr_t makeContext(Arg1 &arg1, Arg2 &arg2, Arg3 &arg3)
85 {
86 return IWORKXMLContextPtr_t(new Context(arg1, arg2, arg3));
87 }
88
89 template<typename Context, typename Arg1, typename Arg2, typename Arg3>
90 IWORKXMLContextPtr_t makeContext(Arg1 &arg1, const Arg2 &arg2, Arg3 &arg3)
91 {
92 return IWORKXMLContextPtr_t(new Context(arg1, arg2, arg3));
93 }
94
95 template<typename Context, typename Arg1, typename Arg2, typename Arg3>
96 IWORKXMLContextPtr_t makeContext(Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
97 {
98 return IWORKXMLContextPtr_t(new Context(arg1, arg2, arg3));
99 }
100
101 template<typename Context, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
102 IWORKXMLContextPtr_t makeContext(Arg1 &arg1, Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
103 {
104 return IWORKXMLContextPtr_t(new Context(arg1, arg2, arg3, arg4));
105 }
106
107 template<typename Context, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
108 IWORKXMLContextPtr_t makeContext(Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
109 {
110 return IWORKXMLContextPtr_t(new Context(arg1, arg2, arg3, arg4));
111 }
112
113 }
114
115 #endif // IWORKXMLCONTEXT_H_INCLUDED
116
117 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek
Definition: IWORKBezierElement.cpp:18
libetonyek::IWORKXMLContext
Definition: IWORKXMLContext.h:22
libetonyek::IWORKXMLContext::endOfElement
virtual void endOfElement()=0
Signalize the end of an element.
libetonyek::IWORKXMLContext::~IWORKXMLContext
virtual ~IWORKXMLContext()=0
Definition: IWORKXMLContext.cpp:15
libetonyek::IWORKXMLContextPtr_t
boost::shared_ptr< IWORKXMLContext > IWORKXMLContextPtr_t
Definition: IWORKXMLContext.h:18
libetonyek::IWORKXMLContext::text
virtual void text(const char *value)=0
Process textual content of an element.
name
const char * name
Definition: IWORKToken.cpp:43
libetonyek::IWORKXMLContext::startOfElement
virtual void startOfElement()=0
Signalize the start of an element.
libetonyek::IWORKXMLContext::attribute
virtual void attribute(int name, const char *value)=0
Process an attribute.
libetonyek::IWORKXMLContext::element
virtual IWORKXMLContextPtr_t element(int name)=0
Create a context for parsing a child element.
libetonyek::makeContext
IWORKXMLContextPtr_t makeContext(Arg &arg)
Definition: IWORKXMLContext.h:60