List of all members.
Detailed Description
A class for handling strings.
Member Function Documentation
- (of_comparison_result_t) caseInsensitiveCompare: |
|
(OFString*) |
str |
|
|
Compares the OFString to another OFString without caring about the case.
- Parameters:
-
| str | A string to compare with |
- Returns:
- An of_comparison_result_t
- (of_unichar_t) characterAtIndex: |
|
(size_t) |
index |
|
|
- Parameters:
-
| index | The index of the Unicode character to return |
- Returns:
- The Unicode character at the specified index
Splits an OFString into an OFArray of OFStrings.
- Parameters:
-
| delimiter | The delimiter for splitting |
- Returns:
- An autoreleased OFArray with the splitted string
- (BOOL) containsString: |
|
(OFString*) |
str |
|
|
- Parameters:
-
- Returns:
- Whether the string contains the specified string
- Returns:
- The OFString as a UTF-8 encoded C string
- Returns:
- The length of the string which cString would return
- (intmax_t) decimalValue |
|
|
|
|
Returns the decimal value of the string as an intmax_t or throws an OFInvalidEncodingException if the string contains any non-number characters. Leading and trailing whitespaces are ignored.
If the number is too big to fit into an intmax_t, an OFOutOfRangeException is thrown.
- Returns:
- An intmax_t with the value of the string
Returns the double value of the string as a float or throws an OFInvalidEncodingException if the string contains any non-number characters.
- Returns:
- A double with the value of the string
Returns the float value of the string as a float or throws an OFInvalidEncodingException if the string contains any non-number characters.
- Returns:
- A float with the value of the string
Checks whether the string has the specified prefix.
- Parameters:
-
| prefix | The prefix to check for |
- Returns:
- A boolean whether the string has the specified prefix
Checks whether the string has the specified suffix.
- Parameters:
-
| suffix | The suffix to check for |
- Returns:
- A boolean whether the string has the specified suffix
- (uintmax_t) hexadecimalValue |
|
|
|
|
Returns the hexadecimal value of the string as an uintmax_t or throws an OFInvalidEncodingException if the string contains any non-number characters. Leading and trailing whitespaces are ignored.
If the number is too big to fit into an uintmax_t, an OFOutOfRangeException is thrown.
- Returns:
- A uintmax_t with the value of the string
- (size_t) indexOfFirstOccurrenceOfString: |
|
(OFString*) |
str |
|
|
- Parameters:
-
- Returns:
- The index of the first occurrence of the string or OF_INVALID_INDEX if it was not found
- (size_t) indexOfLastOccurrenceOfString: |
|
(OFString*) |
str |
|
|
- Parameters:
-
- Returns:
- The index of the last occurrence of the string or OF_INVALID_INDEX if it was not found
- (id) initWithContentsOfFile: |
|
(OFString*) |
path |
|
|
Initializes an already allocated OFString with the contents of the specified file in the specified encoding.
- Parameters:
-
| path | The path to the file |
- Returns:
- An initialized OFString
- (id) initWithContentsOfFile: |
|
(OFString*) |
path |
encoding: |
|
(of_string_encoding_t) |
encoding | |
|
|
| | |
Initializes an already allocated OFString with the contents of the specified file in the specified encoding.
- Parameters:
-
| path | The path to the file |
| encoding | The encoding of the file |
- Returns:
- An initialized OFString
- (id) initWithContentsOfURL: |
|
(OFURL*) |
url |
|
|
Initializes an already allocated OFString with the contents of the specified URL, assuming UTF-8 encoding.
- Parameters:
-
| url | The URL to the contents for the string |
- Returns:
- An initialized OFString
- (id) initWithContentsOfURL: |
|
(OFURL*) |
url |
encoding: |
|
(of_string_encoding_t) |
encoding | |
|
|
| | |
Initializes an already allocated OFString with the contents of the specified URL in the specified encoding.
- Parameters:
-
| url | The URL to the contents for the string |
| encoding | The encoding to assume |
- Returns:
- An initialized OFString
- (id) initWithCString: |
|
(const char*) |
str |
|
|
Initializes an already allocated OFString from a UTF-8 encoded C string.
- Parameters:
-
| str | A UTF-8 encoded C string to initialize the OFString with |
- Returns:
- An initialized OFString
- (id) initWithCString: |
|
(const char*) |
str |
encoding: |
|
(of_string_encoding_t) |
encoding | |
|
|
| | |
Initializes an already allocated OFString from a C string with the specified encoding.
- Parameters:
-
| str | A C string to initialize the OFString with |
| encoding | The encoding of the C string |
- Returns:
- An initialized OFString
- (id) initWithCString: |
|
(const char*) |
str |
encoding: |
|
(of_string_encoding_t) |
encoding |
length: |
|
(size_t) |
len | |
|
|
| | |
Initializes an already allocated OFString from a C string with the specified encoding and length.
- Parameters:
-
| str | A C string to initialize the OFString with |
| encoding | The encoding of the C string |
| len | The length of the C string |
- Returns:
- An initialized OFString
- (id) initWithCString: |
|
(const char*) |
str |
length: |
|
(size_t) |
len | |
|
|
| | |
Initializes an already allocated OFString from a UTF-8 encoded C string with the specified length.
- Parameters:
-
| str | A UTF-8 encoded C string to initialize the OFString with |
| len | The length of the UTF-8 encoded C string |
- Returns:
- An initialized OFString
- (id) initWithFormat: |
|
(OFString*) |
fmt |
, |
|
|
... | |
|
|
| | |
Initializes an already allocated OFString with a format string. See printf for the format syntax.
- Parameters:
-
| fmt | A string used as format to initialize the OFString |
- Returns:
- An initialized OFString
- (id) initWithFormat: |
|
(OFString*) |
fmt |
arguments: |
|
(va_list) |
args | |
|
|
| | |
Initializes an already allocated OFString with a format string. See printf for the format syntax.
- Parameters:
-
| fmt | A string used as format to initialize the OFString |
| args | The arguments used in the format string |
- Returns:
- An initialized OFString
- (id) initWithPath: |
|
(OFString*) |
first |
, |
|
|
... | |
|
|
| | |
Initializes an already allocated OFString with the constructed specified path.
- Parameters:
-
| first | The first component of the path |
- Returns:
- A new autoreleased OFString
- (id) initWithPath: |
|
(OFString*) |
first |
arguments: |
|
(va_list) |
args | |
|
|
| | |
Initializes an already allocated OFString with the constructed specified path.
- Parameters:
-
| first | The first component of the path |
| args | A va_list with the other components of the path |
- Returns:
- A new autoreleased OFString
Initializes an already allocated OFString with another string.
- Parameters:
-
| str | A string to initialize the OFString with |
- Returns:
- An initialized OFString
- Returns:
- The last component of the path
- Returns:
- The length of the string in Unicode characters
- Returns:
- The MD5 hash of the string as an autoreleased OFString
- Returns:
- The components of the path
- Returns:
- The SHA1 hash of the string as an autoreleased OFString
Creates a new string by appending another string.
- Parameters:
-
- Returns:
- A new autoreleased OFString with the specified string appended
- (OFString *) stringByDeletingLastPathComponent |
|
|
|
|
- Returns:
- The directory name of the path
- (OFString *) stringByDeletingLeadingAndTrailingWhitespaces |
|
|
|
|
Creates a new string by deleting leading and trailing whitespaces.
- Returns:
- A new autoreleased OFString with leading and trailing whitespaces deleted
- (OFString *) stringByDeletingLeadingWhitespaces |
|
|
|
|
Creates a new string by deleting leading whitespaces.
- Returns:
- A new autoreleased OFString with leading whitespaces deleted
- (OFString *) stringByDeletingTrailingWhitespaces |
|
|
|
|
Creates a new string by deleting trailing whitespaces.
- Returns:
- A new autoreleased OFString with trailing whitespaces deleted
Decodes a string used in a URL.
- Returns:
- A new autoreleased string
Encodes a string for use in a URL.
- Returns:
- A new autoreleased string
Escapes a string for use in an XML document.
- Returns:
- A new autoreleased string
Unescapes XML in the string.
- (OFString*) stringByXMLUnescapingWithBlock: |
|
(of_string_xml_unescaping_block_t) |
block |
|
|
Unescapes XML in the string and uses the specified block for unknown entities.
- Parameters:
-
| block | A block which handles unknown entities |
Unescapes XML in the string and uses the specified delegate for unknown entities.
- Parameters:
-
| delegate | An OFXMLUnescapingDelegate as a handler for unknown entities |
+ (id) stringWithContentsOfFile: |
|
(OFString*) |
path |
|
|
Creates a new OFString with the contents of the specified UTF-8 encoded file.
- Parameters:
-
| path | The path to the file |
- Returns:
- A new autoreleased OFString
+ (id) stringWithContentsOfFile: |
|
(OFString*) |
path |
encoding: |
|
(of_string_encoding_t) |
encoding | |
|
|
| | |
Creates a new OFString with the contents of the specified file in the specified encoding.
- Parameters:
-
| path | The path to the file |
| encoding | The encoding of the file |
- Returns:
- A new autoreleased OFString
+ (id) stringWithContentsOfURL: |
|
(OFURL*) |
url |
|
|
Creates a new OFString with the contents of the specified URL, assuming UTF-8 encoding.
- Parameters:
-
| url | The URL to the contents for the string |
- Returns:
- A new autoreleased OFString
+ (id) stringWithContentsOfURL: |
|
(OFURL*) |
url |
encoding: |
|
(of_string_encoding_t) |
encoding | |
|
|
| | |
Creates a new OFString with the contents of the specified URL in the specified encoding.
- Parameters:
-
| url | The URL to the contents for the string |
| encoding | The encoding to assume |
- Returns:
- A new autoreleased OFString
+ (id) stringWithCString: |
|
(const char*) |
str |
|
|
Creates a new OFString from a UTF-8 encoded C string.
- Parameters:
-
| str | A UTF-8 encoded C string to initialize the OFString with |
- Returns:
- A new autoreleased OFString
+ (id) stringWithCString: |
|
(const char*) |
str |
encoding: |
|
(of_string_encoding_t) |
encoding | |
|
|
| | |
Creates a new OFString from a C string with the specified encoding.
- Parameters:
-
| str | A C string to initialize the OFString with |
| encoding | The encoding of the C string |
- Returns:
- A new autoreleased OFString
+ (id) stringWithCString: |
|
(const char*) |
str |
encoding: |
|
(of_string_encoding_t) |
encoding |
length: |
|
(size_t) |
len | |
|
|
| | |
Creates a new OFString from a C string with the specified encoding and length.
- Parameters:
-
| str | A C string to initialize the OFString with |
| encoding | The encoding of the C string |
| len | The length of the C string |
- Returns:
- A new autoreleased OFString
+ (id) stringWithCString: |
|
(const char*) |
str |
length: |
|
(size_t) |
len | |
|
|
| | |
Creates a new OFString from a UTF-8 encoded C string with the specified length.
- Parameters:
-
| str | A UTF-8 encoded C string to initialize the OFString with |
| len | The length of the UTF-8 encoded C string |
- Returns:
- A new autoreleased OFString
+ (id) stringWithFormat: |
|
(OFString*) |
fmt |
, |
|
|
... | |
|
|
| | |
Creates a new OFString from a format string. See printf for the format syntax.
- Parameters:
-
| fmt | A string used as format to initialize the OFString |
- Returns:
- A new autoreleased OFString
+ (id) stringWithPath: |
|
(OFString*) |
first |
, |
|
|
... | |
|
|
| | |
Creates a new OFString containing the constructed specified path.
- Parameters:
-
| first | The first component of the path |
- Returns:
- A new autoreleased OFString
+ (id) stringWithString: |
|
(OFString*) |
str |
|
|
Creates a new OFString from another string.
- Parameters:
-
| str | A string to initialize the OFString with |
- Returns:
- A new autoreleased OFString
- (OFString *) substringFromIndex: |
|
(size_t) |
start |
toIndex: |
|
(size_t) |
end | |
|
|
| | |
- Parameters:
-
| start | The index where the substring starts |
| end | The index where the substring ends. This points BEHIND the last character! |
- Returns:
- The substring as a new autoreleased OFString
- Parameters:
-
| range | The range of the substring |
- Returns:
- The substring as a new autoreleased OFString
- (of_unichar_t *) unicodeString |
|
|
|
|
Returns the string as an array of of_unichar_t. The result needs to be free()'d by the caller, as the memory is not marked as belonging to the object.
- Returns:
- The string as an array of Unicode characters
Writes the string into the specified file using UTF-8 encoding.
- Parameters:
-
| path | The path of the file to write to |
The documentation for this class was generated from the following files:
- src/OFString+Hashing.m
- src/OFString.h
- src/OFString.m