ObjFW
OFMutableString.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 #ifndef OBJFW_OF_MUTABLE_STRING_H
17 #define OBJFW_OF_MUTABLE_STRING_H
18 
19 #include "OFString.h"
20 
21 OF_ASSUME_NONNULL_BEGIN
22 
23 #ifdef __OBJC__
36 - (void)setCharacter: (of_unichar_t)character atIndex: (size_t)index;
37 
43 - (void)appendString: (OFString *)string;
44 
51 - (void)appendCharacters: (const of_unichar_t *)characters
52  length: (size_t)length;
53 
59 - (void)appendUTF8String: (const char *)UTF8String;
60 
68 - (void)appendUTF8String: (const char *)UTF8String
69  length: (size_t)UTF8StringLength;
70 
77 - (void)appendCString: (const char *)cString
78  encoding: (of_string_encoding_t)encoding;
79 
88 - (void)appendCString: (const char *)cString
89  encoding: (of_string_encoding_t)encoding
90  length: (size_t)cStringLength;
91 
101 - (void)appendFormat: (OFConstantString *)format, ...;
102 
113 - (void)appendFormat: (OFConstantString *)format arguments: (va_list)arguments;
114 
120 - (void)prependString: (OFString *)string;
121 
125 - (void)reverse;
126 
130 - (void)uppercase;
131 
135 - (void)lowercase;
136 
144 - (void)capitalize;
145 
152 - (void)insertString: (OFString *)string atIndex: (size_t)index;
153 
159 - (void)deleteCharactersInRange: (of_range_t)range;
160 
167 - (void)replaceCharactersInRange: (of_range_t)range
168  withString: (OFString *)replacement;
169 
176 - (void)replaceOccurrencesOfString: (OFString *)string
177  withString: (OFString *)replacement;
178 
189 - (void)replaceOccurrencesOfString: (OFString *)string
190  withString: (OFString *)replacement
191  options: (int)options
192  range: (of_range_t)range;
193 
198 
203 
208 
212 - (void)makeImmutable;
213 @end
214 #endif
215 
216 OF_ASSUME_NONNULL_END
217 
218 #endif
of_string_encoding_t
The encoding of a string.
Definition: OFString.h:68
A class for storing constant strings using the @"" literal.
Definition: OFConstantString.h:42
A class for storing and modifying strings.
Definition: OFMutableString.h:30
void makeImmutable()
Converts the mutable string to an immutable string.
Definition: OFMutableString.m:561
void uppercase()
Converts the string to uppercase.
Definition: OFMutableString.m:392
void deleteLeadingWhitespaces()
Deletes all whitespaces at the beginning of the string.
Definition: OFMutableString.m:505
void lowercase()
Converts the string to lowercase.
Definition: OFMutableString.m:400
void capitalize()
Capitalizes the string.
Definition: OFMutableString.m:408
void deleteEnclosingWhitespaces()
Deletes all whitespaces at the beginning and the end of the string.
Definition: OFMutableString.m:550
void reverse()
Reverses the string.
Definition: OFMutableString.m:380
void deleteTrailingWhitespaces()
Deletes all whitespaces at the end of the string.
Definition: OFMutableString.m:523
A class for handling strings.
Definition: OFString.h:132
A range.
Definition: OFObject.h:93