OSString
Member Functions
Abstract: Releases all resources used by the OSString object.
public:
virtual void free();
This function should not be called directly, use release() instead.
Abstract: Returns a pointer to the internal c-string array.
public:
virtual const char *getCStringNoCopy() const;
Result: Returns a pointer to the internal c-string array.
Abstract: Returns a character at a particular index in the string object.
public:
virtual char getChar(unsigned int index) const;
Parameters
Name | Description |
index | The index into the string. |
Result: Returns a character.
Abstract: A member function to return the length of the string.
public:
virtual unsigned int getLength() const;
Result: Returns the length of the string.
Abstract: Member function to initialize an instance of OSString with a simple c-string.
public:
virtual bool initWithCString(const char *cString);
Parameters
Name | Description |
cString | A simple c-string. |
Result: Returns true on success, false otherwise.
Abstract: Member function to initialize 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);
Parameters
Name | Description |
cString | A simple c-string. |
Result: Returns true on success, false otherwise.
Abstract: Member function to initialize an instance of OSString from another OSString object.
public:
virtual bool initWithString(const OSString *aString);
Parameters
Name | Description |
aString | An OSString object. |
Result: Returns true on success, false otherwise.
Abstract: A member function to test the equality of an unknown OSObject derived object and the OSString instance.
public:
virtual bool isEqualTo(const OSObject *obj) const;
Parameters
Name | Description |
obj | An OSObject derived object. |
Result: Returns true if the two objects are equivalent, false otherwise.
Abstract: A member function to test the equality of c-string and the internal string array of the receiving OSString object.
public:
virtual bool isEqualTo(const char *aCString) const;
Parameters
Name | Description |
aCString | A simple c-string. |
Result: Returns true if the two strings are equal, false otherwise.
Abstract: A member function to test the equality of two OSString objects.
public:
virtual bool isEqualTo(const OSString *aString) const;
Parameters
Name | Description |
aString | An OSString object. |
Result: Returns true if the two strings are equal, false otherwise.
Abstract: A member function which archives the receiver.
public:
virtual bool serialize(OSSerialize *s) const;
Parameters
Name | Description |
s | The OSSerialize object. |
Result: Returns true if serialization was successful, false if not.
Abstract: Replaces a character at a particular index in the string object.
public:
virtual bool setChar(char aChar, unsigned int index);
Parameters
Name | Description |
index | The index into the string. |
Result: 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.
Abstract: Static constructor function to create and initialize an instance of OSString.
public:
static OSString *withCString(const char *cString);
Parameters
Name | Description |
cString | A simple c-string. |
Result: Returns an instance of OSString or 0 on error.
Abstract: Static constructor function to create and initialize an instance of OSString but does not copy the original c-string into container.
public:
static OSString *withCStringNoCopy(const char *cString);
Parameters
Name | Description |
cString | A simple c-string. |
Result: Returns an instance of OSString or 0 on error.
Abstract: Static constructor function to create and initialize an instance of OSString from another OSString.
public:
static OSString *withString(const OSString *aString);
Parameters
Name | Description |
aString | An OSString object. |
Result: Returns an instance of OSString or 0 on error.
© 2000 Apple Computer, Inc. (Last Updated 2/23/2000)