Category: Language-C interface
Superclass: CPtr
Technically, CString is really a pointer to CChar. However, it can be very useful as a distinct datatype because it is a separate datatype in Smalltalk, so we allow developers to express their semantics more precisely by using a more descriptive type. Note that like CChar is a pointer to char, CString is actually a *pointer* to string: a char ** in C terms. If you need to take a String out of a char *, use CChar>>#asString. In general, I behave like a cross between an array of characters and a pointer to a character. I provide the protocol for both data types. My #value method returns a Smalltalk String, as you would expect for a scalar datatype.

Method category index

accessing (class)
instance creation (class)
accessing (instance)

accessing (class)

cObjStoredType
Private - Provide a conversion from a CObject to a Smalltalk object to be stored by #at:put:

top


instance creation (class)

type
Answer a CType for the receiver---for example, CByteType if the receiver is CByte.

value: anObject

Answer a newly allocated CObject containing the passed value, anObject. Remember to call #addToBeFinalized if you want the CObject to be automatically freed

top


accessing (instance)

cObjStoredType
Private - Provide a conversion from a CObject to a Smalltalk object to be stored by #at:put:

value

Answer the value the receiver is pointing to. The exact returned value depends on the receiver's class

value: aValue

Set the receiver to point to the value, aValue. The exact meaning of aValue depends on the receiver's class

top