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

Generated for libetonyek by doxygen 1.8.5