KEY2ParserUtils.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 KEY2PARSERUTILS_H_INCLUDED
11#define KEY2PARSERUTILS_H_INCLUDED
12
13#include <utility>
14
15#include <boost/optional.hpp>
16
17#include "KEYTypes_fwd.h"
18
19namespace libetonyek
20{
21
22class KEYXMLReader;
23
29{
30 // disable copying
33
34public:
35 virtual ~KEY2ParserUtils();
36
44 static boost::optional<ID_t> readID(const KEYXMLReader &reader);
45
55 static ID_t readRef(const KEYXMLReader &reader);
56
62 static std::pair<boost::optional<double>, boost::optional<double> > readPoint(const KEYXMLReader &reader);
63
69 static KEYPosition readPosition(const KEYXMLReader &reader);
70
76 static KEYSize readSize(const KEYXMLReader &reader);
77
83 static bool bool_cast(const char *value);
84 static double double_cast(const char *value);
85 static int int_cast(const char *value);
86
87 static double deg2rad(double value);
88
89protected:
91};
92
93}
94
95#endif // KEY2PARSERUTILS_H_INCLUDED
96
97/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
A "mixin" containing a set of helper functions used in parser classes.
Definition: KEY2ParserUtils.h:29
static boost::optional< ID_t > readID(const KEYXMLReader &reader)
Read sfa:ID attribute of an element.
Definition: KEY2ParserUtils.cpp:65
KEY2ParserUtils()
Definition: KEY2ParserUtils.cpp:167
static std::pair< boost::optional< double >, boost::optional< double > > readPoint(const KEYXMLReader &reader)
Read sf:point element.
Definition: KEY2ParserUtils.cpp:87
static KEYSize readSize(const KEYXMLReader &reader)
Read sf:size element.
Definition: KEY2ParserUtils.cpp:122
static ID_t readRef(const KEYXMLReader &reader)
Read a reference element.
Definition: KEY2ParserUtils.cpp:79
static double double_cast(const char *value)
Definition: KEY2ParserUtils.cpp:145
static KEYPosition readPosition(const KEYXMLReader &reader)
Read sf:position element.
Definition: KEY2ParserUtils.cpp:115
KEY2ParserUtils & operator=(const KEY2ParserUtils &other)
virtual ~KEY2ParserUtils()
Definition: KEY2ParserUtils.cpp:61
KEY2ParserUtils(const KEY2ParserUtils &other)
static double deg2rad(double value)
Definition: KEY2ParserUtils.cpp:155
static int int_cast(const char *value)
Definition: KEY2ParserUtils.cpp:150
static bool bool_cast(const char *value)
Convert string value to bool.
Definition: KEY2ParserUtils.cpp:128
Definition: KEYXMLReader.h:21
@ value
Definition: KEY2Token.h:887
Definition: EtonyekDocument.cpp:41
std::string ID_t
Definition: KEYTypes_fwd.h:20
Definition: KEYTypes.h:37
Definition: KEYTypes.h:28

Generated for libetonyek by doxygen 1.9.3