ObjQt  Diff

Differences From Artifact [1450dd7a8e]:

To Artifact [f6d6179376]:


21
22
23
24
25
26
27


28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

51
52
53
21
22
23
24
25
26
27
28
29
30
31

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

51
52
53
54







+
+


-



















-
+



 */

#import <ObjFW/ObjFW.h>

#include <QByteArray>

@interface OFData (QByteArray)
@property (readonly, nonatomic) QByteArray qByteArray;

+ (instancetype)dataWithQByteArray: (const QByteArray &)qByteArray;
- (instancetype)initWithQByteArray: (const QByteArray &)qByteArray;
- (QByteArray)qByteArray;
@end

namespace ObjQt {

static OF_INLINE OFData *
toOF(const QByteArray &qByteArray)
{
	if (qByteArray.isNull())
		return nil;

	return [OFData dataWithQByteArray: qByteArray];
}

static OF_INLINE QByteArray
toQt(OFData *data)
{
	if (data == nil)
		return QByteArray();

	return [data qByteArray];
	return data.qByteArray;
}

}