Artifact 15868110aa8ce46c165519bdb3f6c46ad3414d4f149f23440df4bf9b4bf767d6:
- File
src/OFMutableString.h
— part of check-in
[b91a8283fe]
at
2010-03-05 11:52:18
on branch 0.2
— Merge a few changesets from the default branch into the 0.2 branch.
Changesets:
* b95fcaa6d694
* 804c68d222b4
* da8cd738da3d
* 1109d5ce3419
* d03f5c1ca95d
* 2a7017722165
* 4fccdc79eeb7
* d228149fbc04
* 8782d412a4a6 (user: js, size: 3386) [annotate] [blame] [check-ins using]
/* * Copyright (c) 2008 - 2010 * Jonathan Schleifer <js@webkeks.org> * * All rights reserved. * * This file is part of ObjFW. 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. */ #include <stdio.h> #include <stdarg.h> #import "OFString.h" /** * \brief A class for storing and modifying strings. */ @interface OFMutableString: OFString {} /** * Sets the OFString to the specified UTF-8 encoded C string. * * \param str A UTF-8 encoded C string to set the OFString to. */ - setToCString: (const char*)str; /** * Appends a UTF-8 encoded C string to the OFString. * * \param str A UTF-8 encoded C string to append */ - appendCString: (const char*)str; /** * Appends a UTF-8 encoded C string with the specified length to the OFString. * * \param str A UTF-8 encoded C string to append * \param len The length of the UTF-8 encoded C string */ - appendCString: (const char*)str withLength: (size_t)len; /** * Appends a UTF-8 encoded C string to the OFString without checking whether it * is valid UTF-8. * * Only use this if you are 100% sure the string you append is either ASCII or * UTF-8! * * \param str A UTF-8 encoded C string to append */ - appendCStringWithoutUTF8Checking: (const char*)str; /** * Appends a UTF-8 encoded C string with the specified length to the OFString * without checking whether it is valid UTF-8. * * Only use this if you are 100% sure the string you append is either ASCII or * UTF-8! * * \param str A UTF-8 encoded C string to append * \param len The length of the UTF-8 encoded C string */ - appendCStringWithoutUTF8Checking: (const char*)str length: (size_t)len; /** * Appends another OFString to the OFString. * * \param str An OFString to append */ - appendString: (OFString*)str; /** * Appends a formatted UTF-8 encoded C string to the OFString. * See printf for the format syntax. * * \param fmt A format string which generates the string to append */ - appendWithFormat: (OFString*)fmt, ...; /** * Appends a formatted UTF-8 encoded C string to the OFString. * See printf for the format syntax. * * \param fmt A format string which generates the string to append * \param args The arguments used in the format string */ - appendWithFormat: (OFString*)fmt arguments: (va_list)args; /** * Reverse the OFString. */ - reverse; /** * Upper the OFString. */ - upper; /** * Lower the OFString. */ - lower; /** * Removes the characters at the specified range. * * \param start The index where the deletion should be started * \param end The index until which the characters should be deleted. * This points BEHIND the last character! */ - removeCharactersFromIndex: (size_t)start toIndex: (size_t)end; /** * Replaces all occurrences of a string with another string. * * \param str The string to replace * \param repl The string with which it should be replaced */ - replaceOccurrencesOfString: (OFString*)str withString: (OFString*)repl; /** * Removes all whitespaces at the beginning of a string. */ - removeLeadingWhitespaces; /** * Removes all whitespaces at the end of a string. */ - removeTrailingWhitespaces; /** * Removes all whitespaces at the beginning and the end of a string. */ - removeLeadingAndTrailingWhitespaces; @end