summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2018-03-12 16:03:37 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2018-03-12 16:03:37 +0100
commitedcd81ee493d2db1dac8459c1a772b73ad722ff8 (patch)
tree97ce30736f214b93a3f0b2acabba65edbd660ad8 /src/lib
parent3840aa453c6d24acaab5f25879ff20c7d50da3d3 (diff)
eolian: update class name APIs
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/eolian/Eolian.h26
-rw-r--r--src/lib/eolian/database_class_api.c18
-rw-r--r--src/lib/eolian_cxx/grammar/klass_def.hpp4
3 files changed, 25 insertions, 23 deletions
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index 0faa901cf6..6932909b6c 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -191,6 +191,14 @@ typedef struct _Eolian_Documentation Eolian_Documentation;
191 */ 191 */
192typedef struct _Eolian_Unit Eolian_Unit; 192typedef struct _Eolian_Unit Eolian_Unit;
193 193
194#ifdef __cplusplus
195#define EOLIAN_CAST(type, expr) reinterpret_cast<const type *>(expr)
196#else
197#define EOLIAN_CAST(type, expr) ((const type *)expr)
198#endif
199
200#define EOLIAN_OBJECT(expr) EOLIAN_CAST(Eolian_Object, expr)
201
194typedef enum 202typedef enum
195{ 203{
196 EOLIAN_OBJECT_UNKNOWN = 0, 204 EOLIAN_OBJECT_UNKNOWN = 0,
@@ -1182,7 +1190,11 @@ EAPI Eina_Iterator *eolian_unit_enums_get(const Eolian_Unit *unit);
1182 * 1190 *
1183 * @ingroup Eolian 1191 * @ingroup Eolian
1184 */ 1192 */
1185EAPI Eina_Stringshare *eolian_class_full_name_get(const Eolian_Class *klass); 1193static inline const char *
1194eolian_class_name_get(const Eolian_Class *klass)
1195{
1196 return eolian_object_name_get(EOLIAN_OBJECT(klass));
1197}
1186 1198
1187/* 1199/*
1188 * @brief Returns the name of the given class. 1200 * @brief Returns the name of the given class.
@@ -1192,7 +1204,11 @@ EAPI Eina_Stringshare *eolian_class_full_name_get(const Eolian_Class *klass);
1192 * 1204 *
1193 * @ingroup Eolian 1205 * @ingroup Eolian
1194 */ 1206 */
1195EAPI Eina_Stringshare *eolian_class_name_get(const Eolian_Class *klass); 1207static inline const char *
1208eolian_class_short_name_get(const Eolian_Class *klass)
1209{
1210 return eolian_object_short_name_get(EOLIAN_OBJECT(klass));
1211}
1196 1212
1197/* 1213/*
1198 * @brief Returns an iterator to the namespaces of the given class. 1214 * @brief Returns an iterator to the namespaces of the given class.
@@ -1202,7 +1218,11 @@ EAPI Eina_Stringshare *eolian_class_name_get(const Eolian_Class *klass);
1202 * 1218 *
1203 * @ingroup Eolian 1219 * @ingroup Eolian
1204 */ 1220 */
1205EAPI Eina_Iterator *eolian_class_namespaces_get(const Eolian_Class *klass); 1221static inline Eina_Iterator *
1222eolian_class_namespaces_get(const Eolian_Class *klass)
1223{
1224 return eolian_object_namespaces_get(EOLIAN_OBJECT(klass));
1225}
1206 1226
1207/* 1227/*
1208 * @brief Returns the class type of the given class 1228 * @brief Returns the class type of the given class
diff --git a/src/lib/eolian/database_class_api.c b/src/lib/eolian/database_class_api.c
index dd01dc4e72..f21c3bcdaf 100644
--- a/src/lib/eolian/database_class_api.c
+++ b/src/lib/eolian/database_class_api.c
@@ -6,24 +6,6 @@
6#include "eolian_database.h" 6#include "eolian_database.h"
7#include "eolian_priv.h" 7#include "eolian_priv.h"
8 8
9EAPI Eina_Stringshare *
10eolian_class_full_name_get(const Eolian_Class *cl)
11{
12 return cl ? cl->base.name : NULL;
13}
14
15EAPI Eina_Stringshare *
16eolian_class_name_get(const Eolian_Class *cl)
17{
18 return eolian_object_short_name_get((const Eolian_Object *)cl);
19}
20
21EAPI Eina_Iterator *
22eolian_class_namespaces_get(const Eolian_Class *cl)
23{
24 return eolian_object_namespaces_get((const Eolian_Object *)cl);
25}
26
27EAPI Eolian_Class_Type 9EAPI Eolian_Class_Type
28eolian_class_type_get(const Eolian_Class *cl) 10eolian_class_type_get(const Eolian_Class *cl)
29{ 11{
diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp
index 35c3709f00..11af82cd29 100644
--- a/src/lib/eolian_cxx/grammar/klass_def.hpp
+++ b/src/lib/eolian_cxx/grammar/klass_def.hpp
@@ -115,7 +115,7 @@ struct klass_name
115 : namespaces(namespaces), eolian_name(eolian_name), base_qualifier(base_qualifier) 115 : namespaces(namespaces), eolian_name(eolian_name), base_qualifier(base_qualifier)
116 , type(type) {} 116 , type(type) {}
117 klass_name(Eolian_Class const* klass, qualifier_def base_qualifier) 117 klass_name(Eolian_Class const* klass, qualifier_def base_qualifier)
118 : eolian_name( ::eolian_class_name_get(klass)) 118 : eolian_name( ::eolian_class_short_name_get(klass))
119 , base_qualifier(base_qualifier) 119 , base_qualifier(base_qualifier)
120 { 120 {
121 for(efl::eina::iterator<const char> namespace_iterator ( ::eolian_class_namespaces_get(klass)) 121 for(efl::eina::iterator<const char> namespace_iterator ( ::eolian_class_namespaces_get(klass))
@@ -940,7 +940,7 @@ struct klass_def
940 { 940 {
941 this->namespaces.push_back(&*namespace_iterator); 941 this->namespaces.push_back(&*namespace_iterator);
942 } 942 }
943 cxx_name = eolian_name = eolian_class_name_get(klass); 943 cxx_name = eolian_name = eolian_class_short_name_get(klass);
944 filename = eolian_object_file_get((const Eolian_Object *)klass); 944 filename = eolian_object_file_get((const Eolian_Object *)klass);
945 for(efl::eina::iterator<Eolian_Function const> eolian_functions ( ::eolian_class_functions_get(klass, EOLIAN_PROPERTY)) 945 for(efl::eina::iterator<Eolian_Function const> eolian_functions ( ::eolian_class_functions_get(klass, EOLIAN_PROPERTY))
946 , functions_last; eolian_functions != functions_last; ++eolian_functions) 946 , functions_last; eolian_functions != functions_last; ++eolian_functions)