Skip to content

Instantly share code, notes, and snippets.

@mrexodia mrexodia/Type.hpp
Created Sep 22, 2016

Embed
What would you like to do?
Type
#pragma once
#include <string>
#include <vector>
namespace Type
{
enum Primitive
{
Int8,
Int16,
Int32,
Int64,
Uint8,
Uint16,
Uint32,
Uint64,
Dsint,
Duint,
Pointer
};
struct Type
{
std::string name; //Type identifier.
Primitive primitive; //Primitive type.
int bitsize; //Size in bits.
std::string pointto; //Type identifier of *Type
};
struct Member
{
std::string name; //Member identifier
std::string type; //Type.name
int offset; //Member offset in Struct (ignored for enums)
int arrsize; //Number of elements if Member is an array
};
struct Struct
{
std::string name; //Struct identifier
std::vector<Member> members; //Struct members
};
struct Union
{
std::string name; //Union name
std::vector<Member> members; //Union members
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.