ObjFW  Diff

Differences From Artifact [71d4835865]:

To Artifact [b7ca2d5c06]:


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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73




























74
75
76
77
78
79
80

#include <stdio.h>
#include <stdarg.h>

#import "OFObject.h"
#import "OFArray.h"



/**
 * A class for managing strings.
 */
@interface OFString: OFObject <OFCopying>
{
	char	     *string;
#ifdef __objc_INCLUDE_GNU
	unsigned int length;
#else
	int	     length;
#if __LP64__
	int	     _unused;
#endif
#endif

}

/**
 * \return A new autoreleased OFMutableString
 */
+ string;

/**
 * Creates a new OFMutableString from a C string.
 *
 * \param str A C string to initialize the OFMutableString with
 * \return A new autoreleased OFMutableString
 */
+ stringWithCString: (const char*)str;

/**
 * Creates a new OFMutableString from a format C string.
 * See printf for the format syntax.
 *
 * \param fmt A string used as format to initialize the OFMutableString
 * \return A new autoreleased OFMutableString
 */
+ stringWithFormat: (OFString*)fmt, ...;

/**
 * Creates a new OFMutableString from a format C string.
 * See printf for the format syntax.
 *
 * \param fmt A string used as format to initialize the OFMutableString
 * \param args The arguments used in the format string
 * \return A new autoreleased OFMutableString
 */
+ stringWithFormat: (OFString*)fmt
      andArguments: (va_list)args;

/**
 * Initializes an already allocated OFString.
 *
 * \return An initialized OFString
 */
- init;





























/**
 * \return The OFString as a C string
 */
- (const char*)cString;

/**
 * \return The length of the OFString







>
>














>








|







|








|
















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111

#include <stdio.h>
#include <stdarg.h>

#import "OFObject.h"
#import "OFArray.h"

extern int of_string_check_utf8(const char *str, size_t len);

/**
 * A class for managing strings.
 */
@interface OFString: OFObject <OFCopying>
{
	char	     *string;
#ifdef __objc_INCLUDE_GNU
	unsigned int length;
#else
	int	     length;
#if __LP64__
	int	     _unused;
#endif
#endif
	BOOL	     is_utf8;
}

/**
 * \return A new autoreleased OFMutableString
 */
+ string;

/**
 * Creates a new OFString from a C string.
 *
 * \param str A C string to initialize the OFMutableString with
 * \return A new autoreleased OFMutableString
 */
+ stringWithCString: (const char*)str;

/**
 * Creates a new OFString from a format C string.
 * See printf for the format syntax.
 *
 * \param fmt A string used as format to initialize the OFMutableString
 * \return A new autoreleased OFMutableString
 */
+ stringWithFormat: (OFString*)fmt, ...;

/**
 * Creates a new OFString from a format C string.
 * See printf for the format syntax.
 *
 * \param fmt A string used as format to initialize the OFMutableString
 * \param args The arguments used in the format string
 * \return A new autoreleased OFMutableString
 */
+ stringWithFormat: (OFString*)fmt
      andArguments: (va_list)args;

/**
 * Initializes an already allocated OFString.
 *
 * \return An initialized OFString
 */
- init;

/**
 * Initializes an already allocated OFMutableString from a C string.
 *
 * \param str A C string to initialize the OFMutableString with
 * \return An initialized OFMutableString
 */
- initWithCString: (const char*)str;

/**
 * Initializes an already allocated OFMutableString from a format C string.
 * See printf for the format syntax.
 *
 * \param fmt A string used as format to initialize the OFMutableString
 * \return An initialized OFMutableString
 */
- initWithFormat: (OFString*)fmt, ...;

/**
 * Initializes an already allocated OFMutableString from a format C string.
 * See printf for the format syntax.
 *
 * \param fmt A string used as format to initialize the OFMutableString
 * \param args The arguments used in the format string
 * \return An initialized OFMutableString
 */
- initWithFormat: (OFString*)fmt
    andArguments: (va_list)args;

/**
 * \return The OFString as a C string
 */
- (const char*)cString;

/**
 * \return The length of the OFString
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
- (int)compare: (id)obj;

/**
 * Sets the OFString to the specified OFString.
 *
 * \param str An OFString to set the OFString to.
 */
- setTo: (const char*)str;

/**
 * Appends another OFString to the OFString.
 *
 * \param str An OFString to append
 */
- append: (OFString*)str;







|







122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
- (int)compare: (id)obj;

/**
 * Sets the OFString to the specified OFString.
 *
 * \param str An OFString to set the OFString to.
 */
- setToCString: (const char*)str;

/**
 * Appends another OFString to the OFString.
 *
 * \param str An OFString to append
 */
- append: (OFString*)str;