first commit
This commit is contained in:
44
include/platform/reflection/c_refl.h
Normal file
44
include/platform/reflection/c_refl.h
Normal file
@ -0,0 +1,44 @@
|
||||
/* -----------------------------------------------------------------------------
|
||||
GSFramework
|
||||
Copyright 2001-2011 Emmanuel Julien. All Rights Reserved.
|
||||
----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
#ifndef __NREFL_OBJECT__
|
||||
#define __NREFL_OBJECT__
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
#include "reflection/nenum_string.h"
|
||||
|
||||
|
||||
namespace GS {
|
||||
namespace Reflection {
|
||||
|
||||
struct Property
|
||||
{
|
||||
enum PropType
|
||||
{
|
||||
InvalidProp,
|
||||
BoolProp,
|
||||
CharProp,
|
||||
ShortProp,
|
||||
IntProp,
|
||||
FloatProp,
|
||||
StringProp,
|
||||
EnumProp
|
||||
};
|
||||
|
||||
PropType type;
|
||||
|
||||
const char *name;
|
||||
size_t offset_of;
|
||||
|
||||
Enum::Dict *enum_dict;
|
||||
};
|
||||
|
||||
} // Reflection
|
||||
} // GS
|
||||
|
||||
|
||||
#endif // __NREFL_OBJECT__
|
||||
30
include/platform/reflection/nenum_string.h
Normal file
30
include/platform/reflection/nenum_string.h
Normal file
@ -0,0 +1,30 @@
|
||||
/* -----------------------------------------------------------------------------
|
||||
GSFramework
|
||||
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
|
||||
----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
#ifndef __NENUM_STRING__
|
||||
#define __NENUM_STRING__
|
||||
|
||||
|
||||
namespace GS {
|
||||
namespace Reflection {
|
||||
|
||||
struct Enum
|
||||
{
|
||||
struct Dict
|
||||
{
|
||||
int enum_v;
|
||||
const char *string_v;
|
||||
};
|
||||
|
||||
static const char *toString(int, Dict *);
|
||||
static int fromString(const char *, Dict *);
|
||||
};
|
||||
|
||||
} // Reflection
|
||||
} // GS
|
||||
|
||||
|
||||
#endif // __NENUM_STRING__
|
||||
Reference in New Issue
Block a user