IWORKFieldElement.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 IWORKFIELDELEMENT_H_INCLUDED
11 #define IWORKFIELDELEMENT_H_INCLUDED
12
13 #include <boost/optional.hpp>
14
15 #include "IWORKEnum.h"
16
17 #include "IWORKXMLContextBase.h"
18
19 namespace libetonyek
20 {
21
22 class IWORKFieldElement : public IWORKXMLMixedContextBase
23 {
24 public:
25 IWORKFieldElement(IWORKXMLParserState &state, IWORKFieldType type);
26
27 protected:
28 void attribute(int name, const char *value) override;
29 IWORKXMLContextPtr_t element(int name) override;
30 void text(const char *value) override;
31 void endOfElement() override;
32
33 private:
34 IWORKFieldType m_type;
35 boost::optional<unsigned> m_value;
36 boost::optional<std::string> m_val;
37 };
38
39 }
40
41 #endif // IWORKFIELDELEMENT_H_INCLUDED
42
43 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek
Definition: IWORKBezierElement.cpp:20
libetonyek::IWORKXMLContextPtr_t
std::shared_ptr< IWORKXMLContext > IWORKXMLContextPtr_t
Definition: IWORKXMLContext.h:18
IWORKXMLContextBase.h
libetonyek::IWORKFieldElement
Definition: IWORKFieldElement.h:22
libetonyek::IWORKToken::value
Definition: IWORKToken.h:624
libetonyek::IWORKFieldElement::m_val
boost::optional< std::string > m_val
Definition: IWORKFieldElement.h:36
libetonyek::IWORKFieldElement::m_value
boost::optional< unsigned > m_value
Definition: IWORKFieldElement.h:35
name
const char * name
Definition: IWORKToken.cpp:43
IWORKEnum.h
libetonyek::IWORKFieldElement::element
IWORKXMLContextPtr_t element(int name) override
Definition: IWORKFieldElement.cpp:45
libetonyek::IWORKFieldElement::endOfElement
void endOfElement() override
Definition: IWORKFieldElement.cpp:68
libetonyek::IWORKXMLContextBase
Definition: IWORKXMLContextBase.h:27
libetonyek::IWORKXMLParserState
Definition: IWORKXMLParserState.h:31
libetonyek::IWORKFieldType
IWORKFieldType
Definition: IWORKEnum.h:142
libetonyek::IWORKFieldElement::attribute
void attribute(int name, const char *value) override
Definition: IWORKFieldElement.cpp:29
libetonyek::IWORKFieldElement::m_type
IWORKFieldType m_type
Definition: IWORKFieldElement.h:34
libetonyek::IWORKToken::type
Definition: IWORKToken.h:486
libetonyek::IWORKFieldElement::IWORKFieldElement
IWORKFieldElement(IWORKXMLParserState &state, IWORKFieldType type)
Definition: IWORKFieldElement.cpp:21
libetonyek::IWORKFieldElement::text
void text(const char *value) override
Definition: IWORKFieldElement.cpp:62