ObjFW
OFMethodSignature.h
1 /*
2  * Copyright (c) 2008-2021 Jonathan Schleifer <js@nil.im>
3  *
4  * All rights reserved.
5  *
6  * This file is part of ObjFW. It may be distributed under the terms of the
7  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
8  * the packaging of this file.
9  *
10  * Alternatively, it may be distributed under the terms of the GNU General
11  * Public License, either version 2 or 3, which can be found in the file
12  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
13  * file.
14  */
15 
16 #import "OFObject.h"
17 
18 OF_ASSUME_NONNULL_BEGIN
19 
20 @class OFMutableData;
21 
28 {
29  char *_types;
30  OFMutableData *_typesPointers, *_offsets;
31  OF_RESERVE_IVARS(OFMethodSignature, 4)
32 }
33 
37 @property (readonly, nonatomic) size_t numberOfArguments;
38 
42 @property (readonly, nonatomic) const char *methodReturnType;
43 
49 @property (readonly, nonatomic) size_t frameLength;
50 
57 + (instancetype)signatureWithObjCTypes: (const char *)types;
58 
66 - (instancetype)initWithObjCTypes: (const char *)types;
67 
74 - (const char *)argumentTypeAtIndex: (size_t)index;
75 
85 - (size_t)argumentOffsetAtIndex: (size_t)index;
86 @end
87 
88 #ifdef __cplusplus
89 extern "C" {
90 #endif
97 extern size_t of_sizeof_type_encoding(const char *type);
98 
105 extern size_t of_alignof_type_encoding(const char *type);
106 #ifdef __cplusplus
107 }
108 #endif
109 
110 OF_ASSUME_NONNULL_END
A class for parsing type encodings and accessing them.
Definition: OFMethodSignature.h:28
A class for storing and manipulating arbitrary data in an array.
Definition: OFMutableData.h:29
The root class for all other classes inside ObjFW.
Definition: OFObject.h:520