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

- File List
- File Members

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
19 namespace libetonyek
20 {
21
22 class KEYXMLReader;
23
28 class KEY2ParserUtils
29 {
30 // disable copying
31 KEY2ParserUtils(const KEY2ParserUtils &other);
32 KEY2ParserUtils &operator=(const KEY2ParserUtils &other);
33
34 public:
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
89 protected:
90 KEY2ParserUtils();
91 };
92
93 }
94
95 #endif // KEY2PARSERUTILS_H_INCLUDED
96
97 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek::KEY2ParserUtils::readPoint
static std::pair< boost::optional< double >, boost::optional< double > > readPoint(const KEYXMLReader &reader)
Read sf:point element.
Definition: KEY2ParserUtils.cpp:87
libetonyek::KEY2ParserUtils::double_cast
static double double_cast(const char *value)
Definition: KEY2ParserUtils.cpp:145
libetonyek::KEY2ParserUtils::operator=
KEY2ParserUtils & operator=(const KEY2ParserUtils &other)
KEYTypes_fwd.h
libetonyek::KEY2ParserUtils::deg2rad
static double deg2rad(double value)
Definition: KEY2ParserUtils.cpp:155
libetonyek::KEY2ParserUtils::~KEY2ParserUtils
virtual ~KEY2ParserUtils()
Definition: KEY2ParserUtils.cpp:61
libetonyek::KEY2ParserUtils::bool_cast
static bool bool_cast(const char *value)
Convert string value to bool.
Definition: KEY2ParserUtils.cpp:128
libetonyek::KEY2ParserUtils::readSize
static KEYSize readSize(const KEYXMLReader &reader)
Read sf:size element.
Definition: KEY2ParserUtils.cpp:122
libetonyek::KEYSize
Definition: KEYTypes.h:27
libetonyek::KEY2Token::value
Definition: KEY2Token.h:887
libetonyek::KEY2ParserUtils::readRef
static ID_t readRef(const KEYXMLReader &reader)
Read a reference element.
Definition: KEY2ParserUtils.cpp:79
libetonyek::KEY2ParserUtils::readID
static boost::optional< ID_t > readID(const KEYXMLReader &reader)
Read sfa:ID attribute of an element.
Definition: KEY2ParserUtils.cpp:65
libetonyek::KEY2ParserUtils::readPosition
static KEYPosition readPosition(const KEYXMLReader &reader)
Read sf:position element.
Definition: KEY2ParserUtils.cpp:115
libetonyek::KEY2ParserUtils
A "mixin" containing a set of helper functions used in parser classes.
Definition: KEY2ParserUtils.h:28
libetonyek::KEY2ParserUtils::int_cast
static int int_cast(const char *value)
Definition: KEY2ParserUtils.cpp:150
libetonyek::KEY2ParserUtils::KEY2ParserUtils
KEY2ParserUtils()
Definition: KEY2ParserUtils.cpp:167
libetonyek::KEYXMLReader
Definition: KEYXMLReader.h:20
libetonyek::ID_t
std::string ID_t
Definition: KEYTypes_fwd.h:20
libetonyek::KEYPosition
Definition: KEYTypes.h:36