]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/CAttributes.h
Reduce IrrCompileConfig usage to files that actually need it
[irrlicht.git] / source / Irrlicht / CAttributes.h
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt\r
2 // This file is part of the "Irrlicht Engine".\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h\r
4 \r
5 #ifndef __C_ATTRIBUTES_H_INCLUDED__\r
6 #define __C_ATTRIBUTES_H_INCLUDED__\r
7 \r
8 \r
9 #include "IAttributes.h"\r
10 #include "IAttribute.h"\r
11 \r
12 namespace irr\r
13 {\r
14 namespace video\r
15 {\r
16         class ITexture;\r
17         class IVideoDriver;\r
18 }\r
19 namespace io\r
20 {\r
21 \r
22 \r
23 //! Implementation of the IAttributes interface\r
24 class CAttributes : public IAttributes\r
25 {\r
26 public:\r
27 \r
28         CAttributes(video::IVideoDriver* driver=0);\r
29         ~CAttributes();\r
30 \r
31         //! Returns amount of attributes in this collection of attributes.\r
32         u32 getAttributeCount() const override;\r
33 \r
34         //! Returns attribute name by index.\r
35         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
36         const c8* getAttributeName(s32 index) const override;\r
37 \r
38         //! Returns the type of an attribute\r
39         //! \param attributeName: Name for the attribute\r
40         E_ATTRIBUTE_TYPE getAttributeType(const c8* attributeName) const override;\r
41 \r
42         //! Returns attribute type by index.\r
43         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
44         E_ATTRIBUTE_TYPE getAttributeType(s32 index) const override;\r
45 \r
46         //! Returns the type string of the attribute\r
47         //! \param attributeName: String for the attribute type\r
48         //! \param defaultNotFound Value returned when attributeName was not found\r
49         const wchar_t* getAttributeTypeString(const c8* attributeName, const wchar_t* defaultNotFound = L"unknown") const override;\r
50 \r
51         //! Returns the type string of the attribute by index.\r
52         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
53         const wchar_t* getAttributeTypeString(s32 index, const wchar_t* defaultNotFound = L"unknown") const override;\r
54 \r
55         //! Returns if an attribute with a name exists\r
56         bool existsAttribute(const c8* attributeName) const override;\r
57 \r
58         //! Returns attribute index from name, -1 if not found\r
59         s32 findAttribute(const c8* attributeName) const override;\r
60 \r
61         //! Removes all attributes\r
62         void clear() override;\r
63 \r
64 \r
65         /*\r
66 \r
67                 Integer Attribute\r
68 \r
69         */\r
70 \r
71         //! Adds an attribute as integer\r
72         void addInt(const c8* attributeName, s32 value) override;\r
73 \r
74         //! Sets an attribute as integer value\r
75         void setAttribute(const c8* attributeName, s32 value) override;\r
76 \r
77         //! Gets an attribute as integer value\r
78         //! \param attributeName: Name of the attribute to get.\r
79         //! \param defaultNotFound Value returned when attributeName was not found\r
80         //! \return Returns value of the attribute previously set by setAttribute()\r
81         s32 getAttributeAsInt(const c8* attributeName, irr::s32 defaultNotFound=0) const override;\r
82 \r
83         //! Gets an attribute as integer value\r
84         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
85         s32 getAttributeAsInt(s32 index) const override;\r
86 \r
87         //! Sets an attribute as integer value\r
88         void setAttribute(s32 index, s32 value) override;\r
89 \r
90         /*\r
91 \r
92                 Float Attribute\r
93 \r
94         */\r
95 \r
96         //! Adds an attribute as float\r
97         void addFloat(const c8* attributeName, f32 value) override;\r
98 \r
99         //! Sets a attribute as float value\r
100         void setAttribute(const c8* attributeName, f32 value) override;\r
101 \r
102         //! Gets an attribute as float value\r
103         //! \param attributeName: Name of the attribute to get.\r
104         //! \param defaultNotFound Value returned when attributeName was not found\r
105         //! \return Returns value of the attribute previously set by setAttribute()\r
106         f32 getAttributeAsFloat(const c8* attributeName, irr::f32 defaultNotFound=0.f) const override;\r
107 \r
108         //! Gets an attribute as float value\r
109         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
110         f32 getAttributeAsFloat(s32 index) const override;\r
111 \r
112         //! Sets an attribute as float value\r
113         void setAttribute(s32 index, f32 value) override;\r
114 \r
115 \r
116         /*\r
117                 Bool Attribute\r
118         */\r
119 \r
120         //! Adds an attribute as bool\r
121         void addBool(const c8* attributeName, bool value) override;\r
122 \r
123         //! Sets an attribute as boolean value\r
124         void setAttribute(const c8* attributeName, bool value) override;\r
125 \r
126         //! Gets an attribute as boolean value\r
127         //! \param attributeName: Name of the attribute to get.\r
128         //! \param defaultNotFound Value returned when attributeName was not found\r
129         //! \return Returns value of the attribute previously set by setAttribute()\r
130         bool getAttributeAsBool(const c8* attributeName, bool defaultNotFound=false) const override;\r
131 \r
132         //! Gets an attribute as boolean value\r
133         //! \param index: Index value, must be between 0 and getAttributeCount()-1.\r
134         bool getAttributeAsBool(s32 index) const override;\r
135 \r
136         //! Sets an attribute as boolean value\r
137         void setAttribute(s32 index, bool value) override;\r
138 \r
139 protected:\r
140 \r
141         core::array<IAttribute*> Attributes;\r
142 \r
143         IAttribute* getAttributeP(const c8* attributeName) const;\r
144 \r
145         video::IVideoDriver* Driver;\r
146 };\r
147 \r
148 } // end namespace io\r
149 } // end namespace irr\r
150 \r
151 #endif\r
152 \r