• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • kasten
  • controllers
  • view
  • structures
  • datatypes
primitivedatatype.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Okteta Kasten Framework, made within the KDE community.
3  *
4  * Copyright 2012 Alex Richardson <alex.richardson@gmx.de>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) version 3, or any
10  * later version accepted by the membership of KDE e.V. (or its
11  * successor approved by the membership of KDE e.V.), which shall
12  * act as a proxy defined in Section 6 of version 3 of the license.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
21  */
22 #ifndef PRIMTIVEDATATYPE_H_
23 #define PRIMTIVEDATATYPE_H_
24 
25 class QDebug;
26 class QString;
27 
28 enum PrimitiveDataTypeEnum
29 {
31  Type_Invalid = -1,
32  Type_START = 0,
33  Type_Bool8 = 0,
34  Type_Int8 = 1,
35  Type_UInt8 = 2,
36  Type_Char = 3,
37  Type_Bool16 = 4,
38  Type_Int16 = 5,
39  Type_UInt16 = 6,
40  Type_Bool32 = 7,
41  Type_Int32 = 8,
42  Type_UInt32 = 9,
43  Type_Bool64 = 10,
44  Type_Int64 = 11,
45  Type_UInt64 = 12,
46  Type_Float = 13,
47  Type_Double = 14,
48  Type_Bitfield = 15,
49  Type_END = Type_Bitfield
50 };
51 
52 //a wrapper struct to prevent implicit conversion to int/bool
53 //TODO remove once we compile with C++11 (enum class) and rename PrimitiveDataTypeEnum again
54 struct PrimitiveDataType
55 {
56  PrimitiveDataTypeEnum value;
57 
58  //allow implicit conversion
59  PrimitiveDataType(PrimitiveDataTypeEnum e) : value(e) {}
60 
61  inline bool operator==(const PrimitiveDataType& other) const
62  {
63  return value == other.value;
64  }
65 
66  inline bool operator!=(const PrimitiveDataType& other) const
67  {
68  return value != other.value;
69  }
70 };
71 
72 namespace PrimitiveType
73 {
76  QString typeName(PrimitiveDataType type);
78  QString standardTypeName(PrimitiveDataType type);
80  QString longTypeName(PrimitiveDataType type);
81 }
82 
83 QDebug operator<<(QDebug dbg, PrimitiveDataType type);
84 
85 #endif /* PRIMTIVEDATATYPE_H_ */
PrimitiveDataType::operator!=
bool operator!=(const PrimitiveDataType &other) const
Definition: primitivedatatype.h:66
Type_Bool32
Definition: primitivedatatype.h:40
PrimitiveType::typeName
QString typeName(PrimitiveDataType type)
Definition: primitivedatatype.cpp:68
Type_Int64
Definition: primitivedatatype.h:44
PrimitiveType::longTypeName
QString longTypeName(PrimitiveDataType type)
Definition: primitivedatatype.cpp:85
Type_Bool16
Definition: primitivedatatype.h:37
Type_END
Definition: primitivedatatype.h:49
operator<<
QDebug operator<<(QDebug dbg, PrimitiveDataType type)
Definition: primitivedatatype.cpp:94
Type_UInt32
Definition: primitivedatatype.h:42
PrimitiveDataType
Definition: primitivedatatype.h:54
Type_UInt16
Definition: primitivedatatype.h:39
Type_UInt64
Definition: primitivedatatype.h:45
PrimitiveDataType::operator==
bool operator==(const PrimitiveDataType &other) const
Definition: primitivedatatype.h:61
Type_Bool64
Definition: primitivedatatype.h:43
Type_Char
Definition: primitivedatatype.h:36
Type_Float
Definition: primitivedatatype.h:46
Type_Int16
Definition: primitivedatatype.h:38
Type_Bitfield
Definition: primitivedatatype.h:48
PrimitiveType::standardTypeName
QString standardTypeName(PrimitiveDataType type)
Definition: primitivedatatype.cpp:76
Type_Int32
Definition: primitivedatatype.h:41
PrimitiveDataTypeEnum
PrimitiveDataTypeEnum
Definition: primitivedatatype.h:28
Type_Invalid
!! DO NOT CHANGE ORDER OF ITEMS !!!
Definition: primitivedatatype.h:31
Type_Int8
Definition: primitivedatatype.h:34
PrimitiveDataType::PrimitiveDataType
PrimitiveDataType(PrimitiveDataTypeEnum e)
Definition: primitivedatatype.h:59
Type_UInt8
Definition: primitivedatatype.h:35
Type_Bool8
Definition: primitivedatatype.h:33
Type_START
Definition: primitivedatatype.h:32
Type_Double
Definition: primitivedatatype.h:47
PrimitiveDataType::value
PrimitiveDataTypeEnum value
Definition: primitivedatatype.h:56
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okteta

Skip menu "okteta"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal