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
|
*
* Alternatively, it may be distributed under the terms of the GNU General
* Public License, either version 2 or 3, which can be found in the file
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import "OFBytesValue.h"
#import "OFMethodSignature.h"
#import "OFOutOfRangeException.h"
@implementation OFBytesValue
@synthesize objCType = _objCType;
- (instancetype)initWithBytes: (const void *)bytes
objCType: (const char *)objCType
{
self = [super init];
@try {
_size = OFSizeOfTypeEncoding(objCType);
_objCType = objCType;
_bytes = OFAllocMemory(1, _size);
memcpy(_bytes, bytes, _size);
|
|
|
|
|
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
|
*
* Alternatively, it may be distributed under the terms of the GNU General
* Public License, either version 2 or 3, which can be found in the file
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#import "OFConcreteValue.h"
#import "OFMethodSignature.h"
#import "OFOutOfRangeException.h"
@implementation OFConcreteValue
@synthesize objCType = _objCType;
- (instancetype)initWithBytes: (const void *)bytes
objCType: (const char *)objCType
{
self = [super initWithBytes: bytes objCType: objCType];
@try {
_size = OFSizeOfTypeEncoding(objCType);
_objCType = objCType;
_bytes = OFAllocMemory(1, _size);
memcpy(_bytes, bytes, _size);
|