-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmarshallruby.h
More file actions
51 lines (29 loc) · 918 Bytes
/
marshallruby.h
File metadata and controls
51 lines (29 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef MARSHALLRUBY_H
#define MARSHALLRUBY_H
#include <cassert>
#include <QtCore>
#include "ruby_cxx.h"
#include "callargument.h"
/*
负责ruby <=> qt的类型转换
*/
class MarshallRuby
{
public:
/*
数字类型
字符串类型
对象类型
数组类型(元素为数字,字符串,对象)
*/
static QVariant VALUE2Variant(VALUE v);
// Range类型支持
static QVector<QVariant> VALUE2Variant2(VALUE v);
static QVector<QVariant> ARGV2Variant(int argc, VALUE *argv, int start = 0);
// @param v QMetaCallEvent->args()[n]
static VALUE Variant2VALUE(void *v, int type);
/////// 使用MetaElem表示的Variant
static QVector<QSharedPointer<MetaTypeVariant> > VALUE2MTVariant(VALUE v);
static QVector<QSharedPointer<MetaTypeVariant> > ARGV2MTVariant(int argc, VALUE *argv, int start = 1);
};
#endif /* MARSHALLRUBY_H */