ObjFW  Diff

Differences From Artifact [f47fa2a8ee]:

To Artifact [a6c136d668]:


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
/*
 * Copyright (c) 2008
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of libobjfw. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "OFString.h"




@interface OFConstCString: OFString
{
	const char *string;
	size_t	   length;
}







- initAsConstCString: (const char*)str;




- (const char*)cString;




- (size_t)length;






- (OFString*)clone;







- (int)compareTo: (OFString*)str;
@end













>
>
>






>
>
>
>
>
>

>
>
>
>

>
>
>
>

>
>
>
>
>
>

>
>
>
>
>
>
>


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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 * Copyright (c) 2008
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of libobjfw. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "OFString.h"

/**
 * An OFString using a constant C string as internal storage.
 */
@interface OFConstCString: OFString
{
	const char *string;
	size_t	   length;
}

/**
 * Initializes an already allocated OFConstCString.
 * 
 * \param str A constant C string to initialize the OFConstCString with.
 * \returns An initialized OFConstCString
 */
- initAsConstCString: (const char*)str;

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

/**
 * \return The length of the OFConstCString.
 */
- (size_t)length;

/**
 * Clones the OFConstCString, creating a new one.
 * 
 * \return A copy of the OFConstCString
 */
- (OFString*)clone;

/**
 * Compares the OFConstCString to another OFString.
 *
 * \param str An OFString in a compatible type to compare with
 * \return An integer which is the result of the comparison, see strcmp.
 */
- (int)compareTo: (OFString*)str;
@end