ADC Home > Reference Library > Reference > Darwin > Kernel Framework Reference
|
OSString |
Inherits from: | |
Declared In: |
A container class for managing strings.
OSString is a container class for managing arrays of characters. Strings come in two varieties, mutable and immutable. An immutable OSString string is one which was created or initialized with the "NoCopy" functions; all other strings are mutable. When modifying an immutable string, the function called to perform the action will fail.
Releases all resources used by the OSString object.
Returns a character at the specified index in the string object.
Returns a pointer to the internal C string array.
Returns the length of the string.
Initializes an instance of OSString with a simple C string.
Initializes an instance of OSString with a simple C string, but does not copy the string into the container.
Initializes an instance of OSString from another OSString object.
Tests the equality of the specified C string and the internal string array of the receiving OSString object.
Tests the equality of an unknown OSData object and the OSString instance.
Tests the equality of an unknown OSObject-derived object and the OSString instance.
Tests the equality of two OSString objects.
Archives the receiver.
Replaces a character at the specified index in the string object.
Creates and initializes an instance of OSString.
Creates and initializes an instance of OSString but does not copy the original C string into container.
Creates and initializes an instance of OSString from another OSString.
free |
Releases all resources used by the OSString object.
public
virtual void free();
This function should not be called directly, use release() instead.
getChar |
Returns a character at the specified index in the string object.
public
virtual char getChar( unsigned int index) const;
index
The index into the string.
Returns a character.
getCStringNoCopy |
Returns a pointer to the internal C string array.
public
virtual const char *getCStringNoCopy() const;
Returns a pointer to the internal C string array.
getLength |
Returns the length of the string.
public
virtual unsigned int getLength() const;
Returns the length of the string.
initWithCString |
Initializes an instance of OSString with a simple C string.
public
virtual bool initWithCString( const char *cString);
cString
A simple C string.
Returns true on success, false otherwise.
initWithCStringNoCopy |
Initializes an instance of OSString with a simple C string, but does not copy the string into the container.
public
virtual bool initWithCStringNoCopy( const char *cString);
cString
A simple C string.
Returns true on success, false otherwise.
initWithString |
Initializes an instance of OSString from another OSString object.
public
virtual bool initWithString( const OSString *aString);
aString
An OSString object.
Returns true on success, false otherwise.
isEqualTo(const char *) |
Tests the equality of the specified C string and the internal string array of the receiving OSString object.
public
virtual bool isEqualTo( const char *aCString) const;
aCString
A simple C string.
Returns true if the two strings are equal, false otherwise.
isEqualTo(const OSData *) |
Tests the equality of an unknown OSData object and the OSString instance.
public
virtual bool isEqualTo( const OSData *obj) const;
obj
An OSData object.
Returns true if the two objects are equivalent, false otherwise.
isEqualTo(const OSMetaClassBase *) |
Tests the equality of an unknown OSObject-derived object and the OSString instance.
public
virtual bool isEqualTo( const OSMetaClassBase *obj) const;
obj
An OSObject-derived object.
Returns true if the two objects are equivalent, false otherwise.
isEqualTo(const OSString *) |
Tests the equality of two OSString objects.
public
virtual bool isEqualTo( const OSString *aString) const;
aString
An OSString object.
Returns true if the two strings are equal, false otherwise.
serialize |
Archives the receiver.
public
virtual bool serialize( OSSerialize *s) const;
s
The OSSerialize object.
Returns true if serialization was successful, false if not.
setChar |
Replaces a character at the specified index in the string object.
public
virtual bool setChar( char aChar, unsigned int index);
index
The index into the string.
Returns true if the character was successfully replaced or false if the string is immutable or index was beyond the bounds of the character array.
withCString |
Creates and initializes an instance of OSString.
public
static OSString *withCString( const char *cString);
cString
A simple C string.
Returns an instance of OSString or 0 on error.
withCStringNoCopy |
Creates and initializes an instance of OSString but does not copy the original C string into container.
public
static OSString *withCStringNoCopy( const char *cString);
cString
A simple C string.
Returns an instance of OSString or 0 on error.
withString |
Creates and initializes an instance of OSString from another OSString.
public
static OSString *withString( const OSString *aString);
aString
An OSString object.
Returns an instance of OSString or 0 on error.
|
Last Updated: 2008-12-19