Functions



free

Abstract: Releases all resources used by the OSString object.
public:

virtual void free();

This function should not be called directly, use release() instead.


getCStringNoCopy

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.

getChar

Abstract: Returns a character at a particular index in the string object.
public:

virtual char getChar(unsigned int index) const;

Parameters

NameDescription
indexThe index into the string.
Result: Returns a character.

getLength

Abstract: A member function to return the length of the string.
public:

virtual unsigned int getLength() const;

Result: Returns the length of the string.

initWithCString

Abstract: Member function to initialize an instance of OSString with a simple c-string.
public:

virtual bool initWithCString(const char *cString);

Parameters

NameDescription
cStringA simple c-string.
Result: Returns true on success, false otherwise.

initWithCStringNoCopy

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

NameDescription
cStringA simple c-string.
Result: Returns true on success, false otherwise.

initWithString

Abstract: Member function to initialize an instance of OSString from another OSString object.
public:

virtual bool initWithString(const OSString *aString);

Parameters

NameDescription
aStringAn OSString object.
Result: Returns true on success, false otherwise.

isEqualTo

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

NameDescription
objAn OSObject derived object.
Result: Returns true if the two objects are equivalent, false otherwise.

isEqualTo

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

NameDescription
aCStringA simple c-string.
Result: Returns true if the two strings are equal, false otherwise.

isEqualTo

Abstract: A member function to test the equality of two OSString objects.
public:

virtual bool isEqualTo(const OSString *aString) const;

Parameters

NameDescription
aStringAn OSString object.
Result: Returns true if the two strings are equal, false otherwise.

serialize

Abstract: A member function which archives the receiver.
public:

virtual bool serialize(OSSerialize *s) const;

Parameters

NameDescription
sThe OSSerialize object.
Result: Returns true if serialization was successful, false if not.

setChar

Abstract: Replaces a character at a particular index in the string object.
public:

virtual bool setChar(char aChar, unsigned int index);

Parameters

NameDescription
indexThe 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.

withCString

Abstract: Static constructor function to create and initialize an instance of OSString.
public:

static OSString *withCString(const char *cString);

Parameters

NameDescription
cStringA simple c-string.
Result: Returns an instance of OSString or 0 on error.

withCStringNoCopy

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

NameDescription
cStringA simple c-string.
Result: Returns an instance of OSString or 0 on error.

withString

Abstract: Static constructor function to create and initialize an instance of OSString from another OSString.
public:

static OSString *withString(const OSString *aString);

Parameters

NameDescription
aStringAn OSString object.
Result: Returns an instance of OSString or 0 on error.

© 2000 Apple Computer, Inc. — (Last Updated 2/23/2000)