+ (id) string
+ (id) stringFromClipboard
Creates a string from clipboard, will return nil if clipboard is empty
+ (id) stringFromClipboardUnit:(ULONG)unit
+ (id) stringFromData:(OBData *)data encoding:(ULONG)mibenum
+ (id) stringWithCString:(const char *)cstring encoding:(ULONG)mibenum
Create a string by either converting to the best underlying format or by copying the data. cstring must be 0-terminated with 0 being mibenum-byte-width wide
+ (id) stringWithCString:(const char *)cstring length:(ULONG)bytes encoding:(ULONG)mibenum
Create a string by either converting to the best underlying format or by copying the data. Length is in *bytes*.
+ (id) stringWithCharacters:(const unichar *)characters length:(ULONG)length __attribute__((deprecated("use +stringWithUnicode:")))
This method is deprecated!
+ (id) stringWithFormat:(OBString *)format, ...
Creates a new string (with UTF16 backing) by converting the format specifiers in the 'format' string using values provided after the string Supported format specifiers include: %@ - Objective-C object, appends the result of the 'description' method %% - '%' character %d,%D - signed 32bit int %u,%U - unsigned 32bit int %x - unsigned 32bit int, printed in hexadecimal, with lowercase a-f %X - unsigned 32bit int, printed in hexadecimal, with lowercase A-F %o,%O - unsigned 32bit int, printed in octal %f - 64bit floating point (double) %e,%E - 64bit floating point value, printed in scientific notation %g,%G - 64bit floating point value, printed in style of %e/E if exponent is less then -4 or greater than or equal to the precision, in %f otherwise %c - 8bit unsigned character %C - 32bit unicode character %s - null-terminated 8bit unsigned characters %S - null-terminated 16bit unicode characters [deprecated] %L - null-terminated 32bit unicode characters %p - void pointer, printed in hexadecimal digits with lowecase a-f and a leading 0x %a,%A - 64bit floating point, printed in scientific notation with leading 0x and one hexadecimal digit before the decimal point using p/P to introduce exponent %F - 64bit floating point, printed in decimal notation Length modifiers: h - used with d, o, u, x, X, conversion applies to an (U)WORD hh - used with d, o, u, x, X, conversion applies to an (U)BYTE l - used with d, o, u, x, X, conversion applies to an (U)LONG ll,q - used with d, o, u, x, X, conversion applies to an (U)QUAD
+ (id) stringWithString:(OBString *)string
+ (id) stringWithUTF8String:(const char *)cstring
+ (id) stringWithUnicode:(const OBUnichar *)characters length:(ULONG)length
Create a string from UTF32 characters of given length (in characters)
+ (id) utf8StringWithString:(OBString *)string
Creates a string with UTF-8 as internal backing. cString returned by it is using its internal storage and remains valid as long as the OBString is valid
- (OBString *) absolutePath
Converts the string to an absolute path, using CurrentDir() as reference: If a Lock() on the whole path fails, will try to resolve the path part in the string and Lock() that, then append FilePart() to resolved string (to handle both write locked and non-existing files). If string is empty, returns the result of Lock("", SHARED_LOCK). Returns self as-is if all of the attempts to resolve the path have failed
- (BOOL) boolValue
Returns a boolean value of the string
- (const char *) cString
Returns an UTF-8 encoded c string
- (OBString *) capitalizedString
Creates a new string with every first letter of a word being uppercase
- (OBComparisonResult) caseInsensitiveCompare:(OBString *)string
Performs a case insensitive compare of two strings
- (unichar) characterAtIndex:(ULONG)index __attribute__((deprecated("use -unicodeAtIndex:")))
Returns a unichode character at a given index counted from 0 This method is DEPRECATED
- (OBComparisonResult) compare:(OBString *)string
Compares the string with the given string
- (OBComparisonResult) compare:(OBString *)string options:(OBStringCompareOptions)options
Compares the string with the given string, limiting the operation to a given range and using the provided options
- (OBComparisonResult) compare:(OBString *)string range:(OBRange)range options:(OBStringCompareOptions)options
- (OBArray *) componentsSeparatedByString:(OBString *)separator
Creates an array of strings using the separator string
- (OBData *) dataWithEncoding:(ULONG)mibenum
Creates an OBData representation of the string, using a given encoding
- (DOUBLE) doubleValue
Returns a float (double-precistion) value of the string or 0.0 if it could not be converted corretly
- (FLOAT) floatValue
Returns a float value of the string or 0.0 if it could not be converted corretly
- (void) getCharacters:(unichar *)buffer __attribute__((deprecated("use -getUnicode:")))
Get whole buffer at once, same as [string getCharacters:buf range:OBMakeRange(0, [string length])]; This method is DEPRECATED
- (void) getCharacters:(unichar *)buffer range:(OBRange)range __attribute__((deprecated("use -getUnicode:range:")))
Fills the buffer with unichar characters of this string Buffer MUST be at least range.length * sizeof(unichar) sized This method is DEPRECATED
- (void) getUnicode:(OBUnichar *)buffer
Fills the buffer with unichar characters of this string Buffer MUST be at least range.length * sizeof(OBUnichar) sized
- (void) getUnicode:(OBUnichar *)buffer range:(OBRange)range
Fills the buffer with unichar characters of this string Buffer MUST be at least range.length * sizeof(unichar) sized
- (BOOL) hasPrefix:(OBString *)prefix
- (BOOL) hasSuffix:(OBString *)suffix
- (ULONG) hash
Returns a hash of the string
- (LONG) intValue
Returns an integer value of the string
- (BOOL) isEqualToString:(OBString *)string
Returns YES if two strings are equal
- (ULONG) length
Length of the string in unicode characters
- (OBString *) lowercaseString
Creates a new string with every character lowercased
- (const char *) nativeCString
Converts the string into a OBNativeString and returns its nativeCString If you need to reuse this string, consider caching an OBNativeString object to avoid converting on the go
- (OBNativeString *) nativeString
Converts the string into a OBNativeString
- (QUAD) quadValue
Returns an 64bit integer value of the string
- (OBRange) rangeOfString:(OBString *)pattern options:(OBStringCompareOptions)options
- (OBRange) rangeOfString:(OBString *)pattern options:(OBStringCompareOptions)options range:(OBRange)range
- (OBString *) stringByAppendingFormat:(OBString *)format, ...
Returns a new string created by combining a string with a formatted string
- (OBString *) stringByAppendingString:(OBString *)string
Returns a new string created by combining two strings
- (OBString *) substringFromIndex:(ULONG)index
Returns a new string starting from the given index
- (OBString *) substringToIndex:(ULONG)index
Returns a new string with index-1 characters of the initial string
- (OBUnichar) unicodeAtIndex:(ULONG)index
Returns a UTF-32 character at a given index counted from 0
- (ULONG) unsignedIntValue
Returns an unsigned integer value of the string
- (OBString *) uppercaseString
Creates a new string with every character uppercased
- (void) writeToClipboard
- (void) writeToClipboardUnit:(ULONG)unit