KEY1StringConverter.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 KEY1STRINGCONVERTER_H_INCLUDED
11#define KEY1STRINGCONVERTER_H_INCLUDED
12
13#include <boost/optional.hpp>
14
15#include <glm/glm.hpp>
16
17#include "IWORKTypes.h"
18
19 namespace libetonyek
20{
21 template<typename T>
22 struct KEY1StringConverter
23{
24 static boost::optional<T> convert(const char *value);
25};
26
27#define KEY1_DECLARE_STRING_CONVERTER(type) \
28 template<> \
29 struct KEY1StringConverter<type> \
30{ \
31 static boost::optional<type> convert (const char *value); \
32}
33
34 KEY1_DECLARE_STRING_CONVERTER(glm::dmat3);
35 KEY1_DECLARE_STRING_CONVERTER(IWORKColor);
36 KEY1_DECLARE_STRING_CONVERTER(IWORKPosition);
37 KEY1_DECLARE_STRING_CONVERTER(IWORKSize);
38}
39
40#endif // KEY1STRINGCONVERTER_H_INCLUDED
41
42/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
IWORKTypes.h
KEY1_DECLARE_STRING_CONVERTER
#define KEY1_DECLARE_STRING_CONVERTER(type)
Definition KEY1StringConverter.h:27
libetonyek::IWORKToken::value
@ value
Definition IWORKToken.h:631
libetonyek
Definition IWORKBezierElement.cpp:21
libetonyek::IWORKColor
Definition IWORKTypes.h:79
libetonyek::IWORKPosition
Definition IWORKTypes.h:53
libetonyek::IWORKSize
Definition IWORKTypes.h:45
libetonyek::KEY1StringConverter
Definition KEY1StringConverter.h:23
libetonyek::KEY1StringConverter::convert
static boost::optional< T > convert(const char *value)
Definition KEY1StringConverter.cpp:28