BlitzMax Extended  0.8.16
Pushing Blitz to the Max.
Data Fields
BBString Struct Reference

Fixed-length string object. More...

#include <blitz_string.h>

+ Inheritance diagram for BBString:

Data Fields

BBClassclas
 The class of the string.
int refs
 The number of times an instance is currently used.
BBSize length
 The length of the string.
BBChar buf []
 Contains the actual string data in UCS-2 encoding.
- Data Fields inherited from BBObject

Additional Inherited Members

- Protected Attributes inherited from BBObject

Detailed Description

Fixed-length string object.

In BlitzMax a string is a complex data type extending BBObject. That means it is usually handled by the GC and can be stored in BBObject pointers for convenience.

All of the string's data is stored in a UCS-2 encoded BBChar buffer. Therefore the length of the buffer equals the string's length.

It can be assumed that every string's class is the bbStringClass, since it's declared as a "Final Type" from the side of BlitzMax. Therefore every pointer of the type BBString* can be used directly with the string functions, instead of looking up the right one in the virtual functions table (bbStringClass.vfns).


Field Documentation

BBClass* BBString::clas

The class of the string.

Note:
Should always point to bbStringClass
See also:
bbStringClass

Reimplemented from BBObject.

BBSize BBString::length
int BBString::refs

The number of times an instance is currently used.

Note:
Only used in single-threaded mode (by the reference-counting GC).
Warning:
Do not change or read this manually, as it is controlled be the runtime.

Reimplemented from BBObject.